indexing description: "Internal message for changing the account to enabled or disabled. " author: "Ueli Weiss" date: "$Date$" revision: "$Revision$" class O_USER_CHANGE_ACCOUNT_ENABLED_MESSAGE inherit O_MESSAGE rename make as make_message redefine make_from_generic end O_USER_CONSTANTS undefine out end create make create {O_MESSAGE_FACTORY} make_from_generic feature {NONE} -- Initialization make (a_name: like name; a_enabled: like enabled) is -- Create. require a_name_ok: a_name /= Void and then not a_name.is_empty do make_message name := a_name enabled := a_enabled ensure name_set: name = a_name enabled_set: enabled = a_enabled 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 name := l_args.item (name_argument) create enabled enabled.set_item (l_args.item (enabled_argument).to_boolean) end feature -- Access namespace: STRING is -- Namespace of the message type. once Result := user_namespace end type: STRING is -- Type of the message. once Result := user_change_account_enabled_type end name: STRING -- Name of the user enabled: BOOLEAN_REF -- shall the account be enabled? arguments: HASH_TABLE [STRING, STRING] is -- Named arguments. do create Result.make (2) Result.force (name, name_argument) Result.force (enabled.out, enabled_argument) end feature {NONE} -- Implementation name_argument: STRING is "name" enabled_argument: STRING is "enabled" invariant name_ok: name /= Void and then not name.is_empty end