com.mooapi.common.message
Class AbstractMessage<T>

java.lang.Object
  extended by com.mooapi.common.message.AbstractMessage<T>
Direct Known Subclasses:
AbstractTypedMessage, RawMessage

public abstract class AbstractMessage<T>
extends java.lang.Object

Message base type.

Author:
Steve Taylor

Constructor Summary
AbstractMessage(T message)
           
 
Method Summary
abstract  RawMessage asRawMessage()
          Generate a raw message equivalent of this message.
abstract  org.apache.mina.common.ByteBuffer encode()
          Encode this message to a buffer.
abstract  boolean equals(java.lang.Object obj)
           
abstract  int getEncodedLength()
          Get the length, in bytes, of this message when encoded.
 T getMessage()
           
abstract  int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMessage

public AbstractMessage(T message)
Method Detail

getMessage

public T getMessage()

getEncodedLength

public abstract int getEncodedLength()
Get the length, in bytes, of this message when encoded.

Returns:
The length of this message when encoded.

encode

public abstract org.apache.mina.common.ByteBuffer encode()
Encode this message to a buffer.

Returns:
A byte buffer containing this message.

asRawMessage

public abstract RawMessage asRawMessage()

Generate a raw message equivalent of this message.

The generated raw message is not backed by this message, so any changes to one do not affact the other.

Returns:
The raw representation of this message.

hashCode

public abstract int hashCode()
Overrides:
hashCode in class java.lang.Object
Returns:
See Also:
Object#hashCode() }

equals

public abstract boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
Parameters:
o -
Returns:
See Also:
Object#equals(java.lang.Object) }


Copyright © 2009. All Rights Reserved.