Class DefaultEntityHelper.MessageWithEntity
java.lang.Object
io.fluxcapacitor.javaclient.modeling.DefaultEntityHelper.MessageWithEntity
- All Implemented Interfaces:
HasMetadata
,HasMessage
,HasEntity
- Enclosing class:
DefaultEntityHelper
protected static class DefaultEntityHelper.MessageWithEntity
extends Object
implements HasMessage, HasEntity
Wraps a message and its corresponding entity for use in interception or handler invocation.
-
Field Summary
Fields inherited from interface io.fluxcapacitor.javaclient.common.HasMessage
warnedAboutMissingProperty
Fields inherited from interface io.fluxcapacitor.common.api.HasMetadata
FINAL_CHUNK
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns theMetadata
associated with this object.<R> R
Retrieves the message payload, deserializing if necessary, cast to the expected type.Returns the underlyingMessage
representation of this object.withEntity
(Entity<?> entity) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.fluxcapacitor.javaclient.common.HasMessage
computeRoutingKey, getMessageId, getPayloadAs, getPayloadClass, getRoutingKey, getRoutingKey, getTimestamp
Methods inherited from interface io.fluxcapacitor.common.api.HasMetadata
chunked, lastChunk
-
Constructor Details
-
MessageWithEntity
-
-
Method Details
-
withEntity
-
getMetadata
Description copied from interface:HasMetadata
Returns theMetadata
associated with this object.- Specified by:
getMetadata
in interfaceHasMetadata
- Returns:
- metadata attached to this instance; never
null
-
toMessage
Description copied from interface:HasMessage
Returns the underlyingMessage
representation of this object.- Specified by:
toMessage
in interfaceHasMessage
- Returns:
- the
Message
backing this instance
-
getPayload
public <R> R getPayload()Description copied from interface:HasMessage
Retrieves the message payload, deserializing if necessary, cast to the expected type.By default, this delegates to
toMessage().getPayload()
.- Specified by:
getPayload
in interfaceHasMessage
- Type Parameters:
R
- the expected payload type- Returns:
- the deserialized payload
-