Interface PayloadAccessor<P>

Type Parameters:
P - The type of the payload to be carried.
All Known Subinterfaces:
PayloadAccessor.PayloadProperty<P>

public interface PayloadAccessor<P>
Provides an accessor for a payload property.
  • Method Details

    • getPayload

      P getPayload()
      Retrieves the payload from the payload property.
      Returns:
      The payload stored by the payload property.
    • getPayloadOr

      default P getPayloadOr(P aValue)
      Retrieves the value from the payload property. If there is no value for the property, then the provided value is returned. Depending on the implementation, not present might mean null or empty as well (being "" for a String).
      Parameters:
      aValue - In case the value to be retrieved is null, then the given value is returned.
      Returns:
      The value stored by the payload property or the given value if the stored value is null.