- 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.
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
PayloadAccessor.PayloadBuilder<P,B extends PayloadAccessor.PayloadBuilder<P,B>>
Provides a builder method for a payload property returning the builder for applying multiple build operations.static interface
PayloadAccessor.PayloadMutator<P>
Provides a mutator for a payload property.static interface
PayloadAccessor.PayloadProperty<P>
Provides a payload property. -
Method Summary
Modifier and Type Method Description P
getPayload()
Retrieves the payload from the payload property.default P
getPayloadOr(P aValue)
Retrieves the value from the payload property.
-
Method Details
-
getPayload
P getPayload()Retrieves the payload from the payload property.- Returns:
- The payload stored by the payload property.
-
getPayloadOr
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 meannull
or empty as well (being "" for aString
).- 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.
-