Class Payload
java.lang.Object
io.axoniq.framework.workflow.dsl.api.Payload
Payload manipulation helper.
- Since:
- 5.4.0
- Author:
- Simon Zambrovski
-
Field Summary
FieldsModifier and TypeFieldDescriptionMap type reference for easy access. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> @Nullable TRetrieves a value from the payload by key.<T> @Nullable TRetrieves a value from the payload by key and converts it using the given converter.Retrieves the underlying payload map.static Payloadpayload()Constructs a new empty payload.static PayloadConstructs a new payload with a single key-value pair.static PayloadConstructs a new payload with two key-value pairs.static Payloadpayload(String key, @Nullable Object value, String key2, @Nullable Object value2, String key3, @Nullable Object value3) Constructs a new payload with three key-value pairs.static PayloadConstructs a new payload around the given value.static Payloadpayload(ProcessingContext processingContext, Object value) Constructs a new payload around the given value, converting it using the given processing context.Sets a value in the payload.Merges another payload into this payload.Fluent payload builder.
-
Field Details
-
Constructor Details
-
Payload
Constructs a new payload around the given map.- Parameters:
payload- payload map.
-
-
Method Details
-
payload
Constructs a new payload around the given value, converting it using the given processing context.- Parameters:
processingContext- processing context for the current workflow invocationvalue- payload value.- Returns:
- payload representation of the given value.
-
payload
Constructs a new payload around the given value.- Parameters:
payload- payload value.- Returns:
- payload representation of the given value.
-
payload
Constructs a new empty payload.- Returns:
- empty payload.
-
payload
Constructs a new payload with a single key-value pair.- Parameters:
key- property name.value- value- Returns:
- payload with one value.
-
payload
public static Payload payload(String key, @Nullable Object value, String key2, @Nullable Object value2) Constructs a new payload with two key-value pairs.- Parameters:
key- property name for the first value.value- first value.key2- property key for the second value.value2- second value.- Returns:
- payload with two values.
-
payload
public static Payload payload(String key, @Nullable Object value, String key2, @Nullable Object value2, String key3, @Nullable Object value3) Constructs a new payload with three key-value pairs.- Parameters:
key- property name for the first value.value- first value.key2- property key for the second value.value2- second value.key3- property key for the third value.value3- third value.- Returns:
- payload with three values.
-
get
Retrieves a value from the payload by key.- Type Parameters:
T- type of the value to retrieve.- Parameters:
key- property key to retrieve.- Returns:
- value associated with the key.
-
getPayloadAs
Retrieves a value from the payload by key and converts it using the given converter.- Type Parameters:
T- type of return value.- Parameters:
key- property name.converter- converter to use.- Returns:
- converter payload.
-
set
Sets a value in the payload.- Parameters:
key- property key.value- value to set.- Returns:
- payload with updated value.
-
with
Merges another payload into this payload.- Parameters:
other- payload to merge.- Returns:
- payload with merged values.
-
with
Fluent payload builder.- Parameters:
key- property key.value- value.- Returns:
- payload with updated value.
-
getValues
Retrieves the underlying payload map.- Returns:
- payload map.
-