indexing description: "Commit add message." author: "Peter Wyss " date: "$Date$" revision: "$Revision$" class O_COMMIT_ADD_MESSAGE inherit O_MESSAGE rename make as make_message redefine make_from_generic end O_COMMIT_CONSTANTS undefine out end create make create {O_MESSAGE_FACTORY} make_from_generic feature {NONE} -- Initialization make (a_user: like user; a_project: like project; a_revision: like revision; a_log: like log; a_diff: like diff) is -- Create. require a_user_ok: a_user /= Void and then not a_user.is_empty a_project_ok: a_project /= Void and then not a_project.is_empty a_revision_ok: a_revision > 0 a_log_ok: a_log /= Void a_diff_ok: a_diff /= Void do make_message user := a_user project := a_project revision := a_revision log := a_log diff := a_diff ensure user_set: user = a_user project_set: project = a_project revision_set: revision = a_revision log_set: log = a_log diff_set: diff = a_diff end make_from_generic (a_msg: O_GENERIC_MESSAGE) is -- Create from a generic message. local l_args: HASH_TABLE [STRING, STRING] do Precursor (a_msg) l_args := a_msg.arguments user := l_args.item (user_argument) project := l_args.item (project_argument) revision := l_args.item (revision_argument).to_integer log := l_args.item (log_argument) diff := l_args.item (diff_argument) end feature -- Access namespace: STRING is -- Namespace of the message type. once Result := commit_namespace end type: STRING is -- Type of the message. once Result := commit_add_type end user: STRING -- Name of the user project: STRING -- name of the project revision: INTEGER -- revision of the commit log: STRING -- log comment diff: STRING -- commit diff arguments: HASH_TABLE [STRING, STRING] is -- Named arguments. do create Result.make (5) Result.force (user, user_argument) Result.force (project, project_argument) Result.force (revision.out, revision_argument) Result.force (log, log_argument) Result.force (diff, diff_argument) end feature {NONE} -- Implementation user_argument: STRING is "user" project_argument: STRING is "project" revision_argument: STRING is "revision" log_argument: STRING is "log" diff_argument: STRING is "diff" invariant user_ok: user /= Void and then not user.is_empty end