indexing description: "Failure message." author: "Patrick Ruckstuhl " date: "$Date$" revision: "$Revision$" class O_GENERAL_STATUS_MESSAGE inherit O_GENERAL_MESSAGE rename make as make_message redefine make_from_generic end create make create {O_MESSAGE_FACTORY} make_from_generic feature {NONE} -- Initialization make (a_success: like is_success; a_message: like message) is -- Create with a success status and a message. require no_success_implies_message: not a_success implies a_message /= Void and then not a_message.is_empty do make_message is_success := a_success if a_message /= Void then message := a_message else message := "" end 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 is_success := l_args.item (success_argument).to_boolean message := l_args.item (message_argument) end feature -- Access type: STRING is -- Type of the message. once Result := general_status_type end is_success: BOOLEAN -- Successful? message: STRING -- Status message. arguments: HASH_TABLE [STRING, STRING] is -- Named arguments. do create Result.make (2) Result.force (is_success.out, success_argument) Result.force (message, message_argument) end feature {NONE} -- Implementation success_argument: STRING is "success" message_argument: STRING is "failure" invariant message_set: message /= Void no_success_implies_message: not is_success implies not message.is_empty end