Spring Integration

org.springframework.integration.message
Class GenericMessage<T>

java.lang.Object
  extended by org.springframework.integration.message.GenericMessage<T>
All Implemented Interfaces:
Serializable, Message<T>
Direct Known Subclasses:
ErrorMessage

public class GenericMessage<T>
extends Object
implements Message<T>, Serializable

Base Message class defining common properties such as id, payload, and headers.

Author:
Mark Fisher
See Also:
Serialized Form

Constructor Summary
GenericMessage(T payload)
          Create a new message with the given payload.
GenericMessage(T payload, Map<String,Object> headers)
          Create a new message with the given payload.
 
Method Summary
 boolean equals(Object obj)
           
 MessageHeaders getHeaders()
           
 T getPayload()
           
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GenericMessage

public GenericMessage(T payload)
Create a new message with the given payload.

Parameters:
payload - the message payload

GenericMessage

public GenericMessage(T payload,
                      Map<String,Object> headers)
Create a new message with the given payload. The provided map will be used to populate the message headers

Parameters:
payload - the message payload
headers - message headers
See Also:
MessageHeaders
Method Detail

getHeaders

public MessageHeaders getHeaders()
Specified by:
getHeaders in interface Message<T>

getPayload

public T getPayload()
Specified by:
getPayload in interface Message<T>

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

Spring Integration

Copyright © 2010. All Rights Reserved.