|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.axonframework.domain.GenericMessage<T>
T
- The type of payload contained in this messagepublic class GenericMessage<T>
Generic implementation of the Message interface.
Constructor Summary | |
---|---|
GenericMessage(String identifier,
T payload,
Map<String,?> metaData)
Constructor to reconstruct a Message using existing data. |
|
GenericMessage(T payload)
Constructs a Message for the given payload using empty meta data. |
|
GenericMessage(T payload,
Map<String,?> metaData)
Constructs a Message for the given payload and meta data . |
Method Summary | |
---|---|
GenericMessage<T> |
andMetaData(Map<String,?> additionalMetaData)
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. |
GenericMessage<T> |
withMetaData(Map<String,?> newMetaData)
Returns a copy of this Message with the given metaData . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GenericMessage(T payload)
payload
using empty meta data.
payload
- The payload for the messagepublic GenericMessage(T payload, Map<String,?> metaData)
payload
and meta data
.
payload
- The payload for the messagemetaData
- The meta data for the messagepublic GenericMessage(String identifier, T payload, Map<String,?> metaData)
identifier
- The identifier of the Messagepayload
- The payload of the messagemetaData
- The meta data of the messageMethod Detail |
---|
public String getIdentifier()
Message
getIdentifier
in interface Message<T>
public MetaData getMetaData()
Message
getMetaData
in interface Message<T>
public T getPayload()
Message
getPayload
in interface Message<T>
public Class getPayloadType()
Message
getPayload().getClass()
, but allows implementations to optimize by using
lazy loading or deserialization.
getPayloadType
in interface Message<T>
public GenericMessage<T> withMetaData(Map<String,?> newMetaData)
Message
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.
withMetaData
in interface Message<T>
newMetaData
- The new MetaData for the Message
public GenericMessage<T> andMetaData(Map<String,?> additionalMetaData)
Message
metaData
. The payload
remains unchanged.
andMetaData
in interface Message<T>
additionalMetaData
- The MetaData to merge with
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |