Interface CommandResultMessage<R>

Type Parameters:
R - The type of payload contained in this Message
All Superinterfaces:
Message<R>, ResultMessage<R>, Serializable
All Known Implementing Classes:
GenericCommandResultMessage

public interface CommandResultMessage<R> extends ResultMessage<R>
Message that represents a result from handling a CommandMessage.
Since:
4.0
Author:
Milan Savic
  • Method Details

    • withMetaData

      CommandResultMessage<R> withMetaData(@Nonnull Map<String,?> metaData)
      Description copied from interface: Message
      Returns a copy of this Message with the given 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.

      Specified by:
      withMetaData in interface Message<R>
      Specified by:
      withMetaData in interface ResultMessage<R>
      Parameters:
      metaData - The new MetaData for the Message
      Returns:
      a copy of this message with the given MetaData
    • andMetaData

      CommandResultMessage<R> andMetaData(@Nonnull Map<String,?> metaData)
      Description copied from interface: Message
      Returns a copy of this Message with it MetaData merged with the given metaData. The payload remains unchanged.
      Specified by:
      andMetaData in interface Message<R>
      Specified by:
      andMetaData in interface ResultMessage<R>
      Parameters:
      metaData - The MetaData to merge with
      Returns:
      a copy of this message with the given MetaData