T
- The type of payload contained in this Messagepublic class GenericDeadlineMessage<T> extends GenericEventMessage<T> implements DeadlineMessage<T>
DeadlineMessage
.clock
Constructor and Description |
---|
GenericDeadlineMessage(String deadlineName)
Instantiate a GenericDeadlineMessage with the given
deadlineName , a null payload and en empty
MetaData . |
GenericDeadlineMessage(String deadlineName,
Message<T> delegate,
Supplier<Instant> timestampSupplier)
Constructor to reconstruct a DeadlineMessage using existing data.
|
GenericDeadlineMessage(String deadlineName,
String identifier,
T payload,
Map<String,?> metaData,
Instant timestamp)
Constructor to reconstructs a DeadlineMessage using existing data.
|
GenericDeadlineMessage(String deadlineName,
T payload)
Instantiate a GenericDeadlineMessage with the given
deadlineName , a payload of type T
and en empty MetaData . |
GenericDeadlineMessage(String deadlineName,
T payload,
Map<String,?> metaData)
Instantiate a GenericDeadlineMessage with the given
deadlineName , a payload of type T
and the given metaData . |
Modifier and Type | Method and Description |
---|---|
GenericDeadlineMessage<T> |
andMetaData(Map<String,?> additionalMetaData)
Returns a copy of this EventMessage with it MetaData merged with the given
metaData . |
static <T> DeadlineMessage<T> |
asDeadlineMessage(String deadlineName,
Object messageOrPayload)
Returns the given
deadlineName and messageOrPayload as a DeadlineMessage. |
protected String |
describeType()
Describe the type of message, used in
MessageDecorator.toString() . |
String |
getDeadlineName()
Retrieve a
String representing the name of this DeadlineMessage. |
GenericDeadlineMessage<T> |
withMetaData(Map<String,?> metaData)
Returns a copy of this EventMessage with the given
metaData . |
asEventMessage, describeTo, getTimestamp
getDelegate, getIdentifier, getMetaData, getPayload, getPayloadType, serializeMetaData, serializePayload, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getIdentifier, getTimestamp
getMetaData, getPayload, getPayloadType, serializeMetaData, serializePayload
public GenericDeadlineMessage(String deadlineName)
deadlineName
, a null
payload and en empty
MetaData
.deadlineName
- A String
denoting the deadline's namepublic GenericDeadlineMessage(String deadlineName, T payload)
deadlineName
, a payload
of type T
and en empty MetaData
.deadlineName
- A String
denoting the deadline's namepayload
- The payload of type T
for the DeadlineMessagepublic GenericDeadlineMessage(String deadlineName, T payload, Map<String,?> metaData)
deadlineName
, a payload
of type T
and the given metaData
.deadlineName
- A String
denoting the deadline's namepayload
- The payload of the MessagemetaData
- The MetaData of the Messagepublic GenericDeadlineMessage(String deadlineName, String identifier, T payload, Map<String,?> metaData, Instant timestamp)
public GenericDeadlineMessage(String deadlineName, Message<T> delegate, Supplier<Instant> timestampSupplier)
public static <T> DeadlineMessage<T> asDeadlineMessage(String deadlineName, Object messageOrPayload)
deadlineName
and messageOrPayload
as a DeadlineMessage. If the
messageOrPayload
parameter is of type Message
, a new DeadlineMessage will be created using the
payload and meta data of the given deadline.
Otherwise, the given messageOrPayload
is wrapped into a GenericDeadlineMessage as its payload.T
- The generic type of the expected payload of the resulting objectdeadlineName
- A String
denoting the deadline's namemessageOrPayload
- A Message
or payload to wrap as a DeadlineMessagedeadlineName
as its deadline name and containing the given
messageOrPayload
as the payloadpublic String getDeadlineName()
DeadlineMessage
String
representing the name of this DeadlineMessage.getDeadlineName
in interface DeadlineMessage<T>
String
representing the name of this DeadlineMessagepublic GenericDeadlineMessage<T> withMetaData(Map<String,?> metaData)
EventMessage
metaData
. The payload, Timestamp
and Identifier
remain unchanged.withMetaData
in interface DeadlineMessage<T>
withMetaData
in interface EventMessage<T>
withMetaData
in interface Message<T>
withMetaData
in class GenericEventMessage<T>
metaData
- The new MetaData for the Messagepublic GenericDeadlineMessage<T> andMetaData(Map<String,?> additionalMetaData)
EventMessage
metaData
. The payload,
Timestamp
and Identifier
remain unchanged.andMetaData
in interface DeadlineMessage<T>
andMetaData
in interface EventMessage<T>
andMetaData
in interface Message<T>
andMetaData
in class GenericEventMessage<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 GenericEventMessage<T>
Copyright © 2010–2019. All rights reserved.