T
- the type of payload contained in the messagepublic class GenericResetContext<T> extends MessageDecorator<T> implements ResetContext<T>
ResetContext
.Constructor and Description |
---|
GenericResetContext(Message<T> message) |
GenericResetContext(T payload)
|
GenericResetContext(T payload,
Map<String,?> metaData)
|
Modifier and Type | Method and Description |
---|---|
GenericResetContext<T> |
andMetaData(Map<String,?> additionalMetaData)
Returns a copy of this
ResetContext with it MetaData merged with the given metaData . |
static <T> ResetContext<T> |
asResetContext(Object messageOrPayload)
Returns the given
messageOrPayload as a ResetContext . |
protected String |
describeType()
Describe the type of message, used in
MessageDecorator.toString() . |
GenericResetContext<T> |
withMetaData(Map<String,?> metaData)
Returns a copy of this
ResetContext with the given metaData . |
describeTo, getDelegate, getIdentifier, getMetaData, getPayload, getPayloadType, serializeMetaData, serializePayload, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getIdentifier, getMetaData, getPayload, getPayloadType, serializeMetaData, serializePayload
public GenericResetContext(T payload)
payload
- the payload be includedpublic GenericResetContext(T payload, Map<String,?> metaData)
payload
- the payload to be includedmetaData
- the MetaData
to be includedpublic static <T> ResetContext<T> asResetContext(Object messageOrPayload)
messageOrPayload
as a ResetContext
. If messageOrPayload
already
implements ResetContext
, it is returned as-is. If it implements Message
, messageOrPayload
will be cast to Message
and current time is used to create a ResetContext
. Otherwise, the given
messageOrPayload
is wrapped into a GenericResetContext
as its payload.T
- the type of payload contained in the messagemessageOrPayload
- the payload to wrap or cast as ResetContext
ResetContext
containing given messageOrPayload
as payload, or the messageOrPayload
if it already implements ResetContext
.public GenericResetContext<T> withMetaData(@Nonnull Map<String,?> metaData)
ResetContext
ResetContext
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.withMetaData
in interface ResetContext<T>
withMetaData
in interface Message<T>
metaData
- the new MetaData for the Messagepublic GenericResetContext<T> andMetaData(@Nonnull Map<String,?> additionalMetaData)
ResetContext
ResetContext
with it MetaData merged with the given metaData
. The payload
remains unchanged.andMetaData
in interface ResetContext<T>
andMetaData
in interface Message<T>
additionalMetaData
- the MetaData to merge withprotected String describeType()
MessageDecorator
MessageDecorator.toString()
.
Defaults to the simple class name of the actual instance.
describeType
in class MessageDecorator<T>
Copyright © 2010–2024. All rights reserved.