org.springframework.integration.message
Class GenericMessage<T>
java.lang.Object
org.springframework.integration.message.GenericMessage<T>
- All Implemented Interfaces:
- java.io.Serializable, Message<T>
- Direct Known Subclasses:
- ErrorMessage
public class GenericMessage<T>
- extends java.lang.Object
- implements Message<T>, java.io.Serializable
Base Message class defining common properties such as id, payload, and headers.
Once created this object is immutable.
- See Also:
- Serialized Form
Constructor Summary |
GenericMessage(T payload)
Create a new message with the given payload. |
GenericMessage(T payload,
java.util.Map<java.lang.String,java.lang.Object> headers)
Create a new message with the given payload. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
GenericMessage
public GenericMessage(T payload)
- Create a new message with the given payload.
- Parameters:
payload
- the message payload
GenericMessage
public GenericMessage(T payload,
java.util.Map<java.lang.String,java.lang.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 payloadheaders
- message headers- See Also:
MessageHeaders
getHeaders
public MessageHeaders getHeaders()
- Specified by:
getHeaders
in interface Message<T>
getPayload
public T getPayload()
- Specified by:
getPayload
in interface Message<T>
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in class java.lang.Object