Class GenericResetContext<T>
java.lang.Object
org.axonframework.messaging.MessageDecorator<T>
org.axonframework.eventhandling.replay.GenericResetContext<T>
- Type Parameters:
T- the type of payload contained in the message
- All Implemented Interfaces:
Serializable,ResetContext<T>,Message<T>
Generic implementation of the
ResetContext.- Since:
- 4.4
- Author:
- Steven van Beelen
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionGenericResetContext(Message<T> message) GenericResetContext(T payload) GenericResetContext(T payload, Map<String, ?> metaData) -
Method Summary
Modifier and TypeMethodDescriptionandMetaData(Map<String, ?> additionalMetaData) Returns a copy of thisResetContextwith it MetaData merged with the givenmetaData.static <T> ResetContext<T> asResetContext(Object messageOrPayload) Returns the givenmessageOrPayloadas aResetContext.protected StringDescribe the type of message, used inMessageDecorator.toString().withMetaData(Map<String, ?> metaData) Returns a copy of thisResetContextwith the givenmetaData.Methods inherited from class org.axonframework.messaging.MessageDecorator
describeTo, getDelegate, getIdentifier, getMetaData, getPayload, getPayloadType, serializeMetaData, serializePayload, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.axonframework.messaging.Message
getIdentifier, getMetaData, getPayload, getPayloadType, serializeMetaData, serializePayload
-
Constructor Details
-
GenericResetContext
- Parameters:
payload- the payload be included
-
GenericResetContext
- Parameters:
payload- the payload to be includedmetaData- theMetaDatato be included
-
GenericResetContext
- Parameters:
message-
-
-
Method Details
-
asResetContext
Returns the givenmessageOrPayloadas aResetContext. IfmessageOrPayloadalready implementsResetContext, it is returned as-is. If it implementsMessage,messageOrPayloadwill be cast toMessageand current time is used to create aResetContext. Otherwise, the givenmessageOrPayloadis wrapped into aGenericResetContextas its payload.- Type Parameters:
T- the type of payload contained in the message- Parameters:
messageOrPayload- the payload to wrap or cast asResetContext- Returns:
- a
ResetContextcontaining givenmessageOrPayloadas payload, or themessageOrPayloadif it already implementsResetContext.
-
withMetaData
Description copied from interface:ResetContextReturns a copy of thisResetContextwith the givenmetaData. The payload remains unchanged. While the implementation returned may be different than the implementation ofthis, implementations must take special care in returning the same type of Message (e.g. EventMessage, DomainEventMessage) to prevent errors further downstream.- Specified by:
withMetaDatain interfaceMessage<T>- Specified by:
withMetaDatain interfaceResetContext<T>- Parameters:
metaData- the new MetaData for the Message- Returns:
- a copy of this message with the given MetaData
-
andMetaData
Description copied from interface:ResetContextReturns a copy of thisResetContextwith it MetaData merged with the givenmetaData. The payload remains unchanged.- Specified by:
andMetaDatain interfaceMessage<T>- Specified by:
andMetaDatain interfaceResetContext<T>- Parameters:
additionalMetaData- the MetaData to merge with- Returns:
- a copy of this message with the given MetaData
-
describeType
Description copied from class:MessageDecoratorDescribe the type of message, used inMessageDecorator.toString().Defaults to the simple class name of the actual instance.
- Overrides:
describeTypein classMessageDecorator<T>- Returns:
- the type of message
-