indexing description: "Project reply message." author: "Peter Wyss " date: "$Date: 2007-05-12 19:57:51 +0200 (Sat, 12 May 2007) $" revision: "$Revision: 257 $" class O_PROJECT_REPLY_MESSAGE inherit O_MESSAGE rename make as make_message redefine make_from_generic end O_PROJECT_CONSTANTS undefine out end create make create {O_MESSAGE_FACTORY} make_from_generic feature {NONE} -- Initialization make (a_project_id: like project_id; a_name: like name; a_description: like description; a_logo: like logo; a_is_closed_source: like is_closed_source) is -- Create. require a_project_id_ok: a_project_id > 0 a_name_ok: a_name /= Void and then not a_name.is_empty a_description_ok: a_description /= Void a_logo_ok: a_logo /= Void do make_message project_id := a_project_id name := a_name description := a_description logo := a_logo is_closed_source := a_is_closed_source ensure project_id_set: project_id = a_project_id name_set: name = a_name description_set: description = a_description logo_set: logo = a_logo is_closed_source_set: is_closed_source = a_is_closed_source 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 project_id := l_args.item (project_id_argument).to_integer name := l_args.item (name_argument) description := l_args.item (description_argument) logo := l_args.item (logo_argument) is_closed_source := l_args.item (is_closed_source_argument).to_boolean end feature -- Access namespace: STRING is -- Namespace of the message type. once Result := project_namespace end type: STRING is -- Type of the message. once Result := project_get_reply_type end project_id: INTEGER --Project Id name: STRING -- Name description: STRING -- Description logo: STRING -- Logo is_closed_source: BOOLEAN -- is closed source? arguments: HASH_TABLE [STRING, STRING] is -- Named arguments. do create Result.make (5) Result.force (project_id.out, project_id_argument) Result.force (name, name_argument) Result.force (description, description_argument) Result.force (logo, logo_argument) Result.force (is_closed_source.out, is_closed_source_argument) end feature {NONE} -- Implementation project_id_argument: STRING is "project_id" name_argument: STRING is "name" description_argument: STRING is "description" logo_argument: STRING is "logo" is_closed_source_argument: STRING is "is_closed_source" invariant project_id_ok: project_id > 0 name_ok: name /= Void and then not name.is_empty description_ok: description /= Void logo_ok: logo /= Void end