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.
  • Constructor Details

    • MessageWithEntity

      public MessageWithEntity(Object payload, Entity<?> entity)
  • Method Details

    • withEntity

      public DefaultEntityHelper.MessageWithEntity withEntity(Entity<?> entity)
    • getMetadata

      public Metadata getMetadata()
      Description copied from interface: HasMetadata
      Returns the Metadata associated with this object.
      Specified by:
      getMetadata in interface HasMetadata
      Returns:
      metadata attached to this instance; never null
    • toMessage

      public Message toMessage()
      Description copied from interface: HasMessage
      Returns the underlying Message representation of this object.
      Specified by:
      toMessage in interface HasMessage
      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 interface HasMessage
      Type Parameters:
      R - the expected payload type
      Returns:
      the deserialized payload