net.sf.genuine.organizer
Class Message

java.lang.Object
  extended bynet.sf.genuine.organizer.Message

public class Message
extends java.lang.Object

A message is part of the framework's messaging system and are intended to be sent to message channels. They consist of a command and an optional object that can hold arbitrary data.

Author:
Tim Wellhausen
See Also:
MessageBus

Constructor Summary
Message(java.lang.String command)
          Creates a new message with the given command, without a data object.
Message(java.lang.String command, java.lang.Object data)
          Creates a new message with the given command and a data object.
 
Method Summary
 java.lang.String getCommand()
          Returns the message's command.
 java.lang.Object getData()
          Returns the optional data.
 boolean isCommand(java.lang.String command)
          Compares this message's command string with the given command string and returns true only if they match.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Message

public Message(java.lang.String command)
Creates a new message with the given command, without a data object.


Message

public Message(java.lang.String command,
               java.lang.Object data)
Creates a new message with the given command and a data object.

Method Detail

isCommand

public boolean isCommand(java.lang.String command)
Compares this message's command string with the given command string and returns true only if they match.


getCommand

public java.lang.String getCommand()
Returns the message's command.


getData

public java.lang.Object getData()
Returns the optional data. May return null.