net.lessy.util.messaging
Class DefaultMessage

java.lang.Object
  extended by net.lessy.util.messaging.DefaultMessage
All Implemented Interfaces:
Message

public class DefaultMessage
extends Object
implements Message

Author:
Hans Lesmeister

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

Constructor Detail

DefaultMessage

public DefaultMessage()
Default


DefaultMessage

public DefaultMessage(String command,
                      Object data)
Method Detail

getCommand

public String getCommand()
Description copied from interface: Message
Returns the message's command.

Specified by:
getCommand in interface Message

getData

public Object getData()
Description copied from interface: Message
Returns the optional data. May return null.

Specified by:
getData in interface Message

isCommand

public boolean isCommand(String command)
Description copied from interface: Message
Compares this message's command string with the given command string and returns true only if they match.

Specified by:
isCommand in interface Message

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012. All Rights Reserved.