indexing description: "Community retrieve reply message." author: "Marco Zietzling " date: "$Date$" revision: "$Revision$" class O_COMMUNITY_RETRIEVE_REPLY_MESSAGE inherit O_MESSAGE rename make as make_message redefine make_from_generic end O_COMMUNITY_CONSTANTS undefine out end create make create {O_MESSAGE_FACTORY} make_from_generic feature {NONE} -- Initialization make (a_community_id: like community_id; a_name: like name; a_description: like description; a_logo: like logo) is -- Create. require a_community_id_ok: a_community_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 community_id := a_community_id name := a_name description := a_description logo := a_logo ensure community_id_set: community_id = a_community_id name_set: name = a_name description_set: description = a_description logo_set: logo = a_logo 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 community_id := l_args.item (community_id_argument).to_integer name := l_args.item (name_argument) description := l_args.item (description_argument) logo := l_args.item (logo_argument) end feature -- Access namespace: STRING is -- Namespace of the message type. once Result := community_namespace end type: STRING is -- Type of the message. once Result := community_retrieve_reply_type end community_id: INTEGER -- Community ID name: STRING -- Name description: STRING -- Description logo: STRING -- Logo arguments: HASH_TABLE [STRING, STRING] is -- Named arguments. do create Result.make (4) Result.force (community_id.out, community_id_argument) Result.force (name, name_argument) Result.force (description, description_argument) Result.force (logo, logo_argument) end feature {NONE} -- Implementation community_id_argument: STRING is "community_id" name_argument: STRING is "name" description_argument: STRING is "description" logo_argument: STRING is "logo" invariant community_id_ok: community_id > 0 name_ok: name /= Void and then not name.is_empty description_ok: description /= Void logo_ok: logo /= Void end