|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.axonframework.commandhandling.GenericCommandMessage<T>
T
- The type of payload contained in this Messagepublic class GenericCommandMessage<T>
Implementation of the CommandMessage that takes all properties as constructor parameters.
Constructor Summary | |
---|---|
protected |
GenericCommandMessage(GenericCommandMessage<T> original,
Map<String,?> metaData)
Copy constructor that allows creation of a new GenericCommandMessage with modified metaData. |
|
GenericCommandMessage(String identifier,
String commandName,
T payload,
Map<String,?> newMetaData)
Create a CommandMessage with the given command as payload and a custom chosen
identifier . |
|
GenericCommandMessage(String commandName,
T payload,
Map<String,?> newMetaData)
Create a CommandMessage with the given command as payload. |
|
GenericCommandMessage(T payload)
Create a CommandMessage with the given command as payload and empty metaData |
|
GenericCommandMessage(T payload,
Map<String,?> newMetaData)
Create a CommandMessage with the given command as payload. |
Method Summary | |
---|---|
GenericCommandMessage<T> |
andMetaData(Map<String,?> additionalMetaData)
Returns a copy of this CommandMessage with it MetaData merged with the given metaData . |
static CommandMessage |
asCommandMessage(Object command)
Returns the given command as a CommandMessage. |
String |
getCommandName()
Returns the name of the command to execute. |
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. |
GenericCommandMessage<T> |
withMetaData(Map<String,?> newMetaData)
Returns a copy of this CommandMessage 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 GenericCommandMessage(T payload)
command
as payload and empty metaData
payload
- the payload for the Messagepublic GenericCommandMessage(T payload, Map<String,?> newMetaData)
command
as payload.
payload
- the payload for the MessagenewMetaData
- The meta data for this messagepublic GenericCommandMessage(String commandName, T payload, Map<String,?> newMetaData)
command
as payload.
commandName
- The name of the commandpayload
- the payload for the MessagenewMetaData
- The meta data for this messagepublic GenericCommandMessage(String identifier, String commandName, T payload, Map<String,?> newMetaData)
command
as payload and a custom chosen
identifier
. Use this constructor to reconstruct instances of existing command messages, which have
already been assigned an identifier.
identifier
- the unique identifier of this messagecommandName
- The name of the commandpayload
- the payload for the MessagenewMetaData
- The meta data for this message (null
results in empty meta data)protected GenericCommandMessage(GenericCommandMessage<T> original, Map<String,?> metaData)
original
is copied, except for the metaData.
original
- The original messagemetaData
- The MetaData for the new messageMethod Detail |
---|
public static CommandMessage asCommandMessage(Object command)
command
already implements CommandMessage, it is
returned as-is. Otherwise, the given command
is wrapped into a GenericCommandMessage as its
payload.
command
- the command to wrap as CommandMessage
command
as payload, or command
if it already
implements CommandMessage.public String getCommandName()
CommandMessage
getCommandName
in interface CommandMessage<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 String getIdentifier()
Message
getIdentifier
in interface Message<T>
public GenericCommandMessage<T> withMetaData(Map<String,?> newMetaData)
CommandMessage
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 CommandMessage<T>
withMetaData
in interface Message<T>
newMetaData
- The new MetaData for the Message
public GenericCommandMessage<T> andMetaData(Map<String,?> additionalMetaData)
CommandMessage
metaData
. The payload
remains unchanged.
andMetaData
in interface CommandMessage<T>
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 |