Class DefaultEntityHelper.MessageWithEntity
java.lang.Object
io.fluxzero.sdk.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 HasMessage
warnedAboutMissingPropertyFields inherited from interface HasMetadata
FINAL_CHUNK -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns theMetadataassociated with this object.<R> RRetrieves the message payload, deserializing if necessary, cast to the expected type.Returns the underlyingMessagerepresentation of this object.withEntity(Entity<?> entity) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface HasMessage
computeRoutingKey, getMessageId, getPayloadAs, getPayloadClass, getRoutingKey, getRoutingKey, getTimestampMethods inherited from interface HasMetadata
chunked, lastChunk
-
Constructor Details
-
MessageWithEntity
-
-
Method Details
-
withEntity
-
getMetadata
Description copied from interface:HasMetadataReturns theMetadataassociated with this object.- Specified by:
getMetadatain interfaceHasMetadata- Returns:
- metadata attached to this instance; never
null
-
toMessage
Description copied from interface:HasMessageReturns the underlyingMessagerepresentation of this object.- Specified by:
toMessagein interfaceHasMessage- Returns:
- the
Messagebacking this instance
-
getPayload
public <R> R getPayload()Description copied from interface:HasMessageRetrieves the message payload, deserializing if necessary, cast to the expected type.By default, this delegates to
toMessage().getPayload().- Specified by:
getPayloadin interfaceHasMessage- Type Parameters:
R- the expected payload type- Returns:
- the deserialized payload
-