Class DefaultEntityHelper.MessageWithEntity
java.lang.Object
io.fluxzero.sdk.modeling.DefaultEntityHelper.MessageWithEntity
- All Implemented Interfaces:
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
FieldsFields inherited from interface HasMessage
warnedAboutMissingProperty -
Constructor Summary
ConstructorsConstructorDescriptionMessageWithEntity(Object payload, Entity<?> entity) MessageWithEntity(Object payload, Entity<?> entity, boolean afterHandler) -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanchunked()default booleanio.fluxzero.common.api.Metadata<R> RRetrieves the message payload, deserializing if necessary, cast to the expected type.default booleanReturns 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, getTimestamp
-
Field Details
-
FIRST_CHUNK
- See Also:
-
FINAL_CHUNK
- See Also:
-
CHUNK_INDEX
- See Also:
-
-
Constructor Details
-
MessageWithEntity
-
MessageWithEntity
-
-
Method Details
-
withEntity
-
getMetadata
public io.fluxzero.common.api.Metadata getMetadata() -
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
-
chunked
default boolean chunked() -
lastChunk
default boolean lastChunk() -
firstChunk
default boolean firstChunk()
-