public class GrpcBackedCommandMessage<C> extends Object implements CommandMessage<C>
Constructor and Description |
---|
GrpcBackedCommandMessage(Command request,
Serializer serializer) |
Modifier and Type | Method and Description |
---|---|
CommandMessage<C> |
andMetaData(Map<String,?> map)
Returns a copy of this CommandMessage with it MetaData merged with the given
metaData . |
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.
|
C |
getPayload()
Returns the payload of this Event.
|
Class<C> |
getPayloadType()
Returns the type of the payload.
|
CommandMessage<C> |
withMetaData(Map<String,?> map)
Returns a copy of this CommandMessage with the given
metaData . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
serializeMetaData, serializePayload
public GrpcBackedCommandMessage(Command request, Serializer serializer)
public String getCommandName()
CommandMessage
getCommandName
in interface CommandMessage<C>
public String getIdentifier()
Message
getIdentifier
in interface Message<C>
public MetaData getMetaData()
Message
getMetaData
in interface Message<C>
public C getPayload()
Message
getPayload
in interface Message<C>
public Class<C> getPayloadType()
Message
getPayload().getClass()
, but allows implementations to optimize by using
lazy loading or deserialization.getPayloadType
in interface Message<C>
public CommandMessage<C> withMetaData(Map<String,?> map)
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<C>
withMetaData
in interface Message<C>
map
- The new MetaData for the Messagepublic CommandMessage<C> andMetaData(Map<String,?> map)
CommandMessage
metaData
. The payload
remains unchanged.andMetaData
in interface CommandMessage<C>
andMetaData
in interface Message<C>
map
- The MetaData to merge withCopyright © 2010–2018. All rights reserved.