public class GenericMessage<T> extends Object implements Message<T>, Serializable
Message
with a generic payload.
Once created, a GenericMessage is immutable.MessageBuilder
,
Serialized FormConstructor and Description |
---|
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 and headers.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
MessageHeaders |
getHeaders()
Return message headers for the message, never
null . |
T |
getPayload()
Return the message payload.
|
int |
hashCode() |
String |
toString() |
public GenericMessage(T payload)
payload
- the message payload, never null
public MessageHeaders getHeaders()
Message
null
.getHeaders
in interface Message<T>
public T getPayload()
Message
getPayload
in interface Message<T>