|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
T
- The type of payload contained in this Messagepublic interface Message<T>
Representation of a Message, containing a Payload and MetaData. Typical examples of Messages are Commands and Events.
Instead of implementingMessage
directly, consider implementing
CommandMessage
or EventMessage
instead.
CommandMessage
,
EventMessage
Method Summary | |
---|---|
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 |
getPayloadType()
Returns the type of the payload. |
Message<T> |
withMetaData(Map<String,?> metaData)
Returns a copy of this Message with the given metaData . |
Method Detail |
---|
String getIdentifier()
MetaData getMetaData()
T getPayload()
Class 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 Message
Message<T> andMetaData(Map<String,?> metaData)
metaData
. The payload
remains unchanged.
metaData
- The MetaData to merge with
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |