T
- The type of payload contained in this Messagepublic interface Message<T> extends Serializable
Message
directly, consider implementing
{@code CommandMessage}
or EventMessage
instead.{@code CommandMessage}
,
EventMessage
Modifier and Type | Method and Description |
---|---|
Message<T> |
andMetaData(Map<String,?> metaData)
Returns a copy of this Message with it MetaData merged with the given
metaData . |
String |
getIdentifier()
Returns the identifier of this message.
|
MetaData |
getMetaData()
Returns the meta data for this event.
|
T |
getPayload()
Returns the payload of this Event.
|
Class<T> |
getPayloadType()
Returns the type of the payload.
|
Message<T> |
withMetaData(Map<String,?> metaData)
Returns a copy of this Message with the given
metaData . |
String getIdentifier()
MetaData getMetaData()
T getPayload()
Class<T> getPayloadType()
getPayload().getClass()
, but allows implementations to optimize by using
lazy loading or deserialization.Message<T> withMetaData(Map<String,?> metaData)
metaData
. The payload remains unchanged.
While the implementation returned may be different than the implementation of this
, implementations
must take special care in returning the same type of Message (e.g. EventMessage, DomainEventMessage) to prevent
errors further downstream.metaData
- The new MetaData for the MessageCopyright © 2010–2017. All rights reserved.