Constructor and Description |
---|
EncodedValues(java.lang.Object... values) |
EncodedValues(java.util.Optional<io.temporal.api.common.v1.Payloads> payloads,
DataConverter converter) |
Modifier and Type | Method and Description |
---|---|
<T> T |
get(int index,
java.lang.Class<T> parameterType)
Get value of the specified type.
|
<T> T |
get(int index,
java.lang.Class<T> parameterType,
java.lang.reflect.Type genericParameterType)
Get value of the specified generic type.
|
int |
getSize() |
void |
setDataConverter(DataConverter converter) |
java.util.Optional<io.temporal.api.common.v1.Payloads> |
toPayloads() |
public EncodedValues(java.util.Optional<io.temporal.api.common.v1.Payloads> payloads, DataConverter converter)
public EncodedValues(java.lang.Object... values)
public java.util.Optional<io.temporal.api.common.v1.Payloads> toPayloads()
public void setDataConverter(DataConverter converter)
public <T> T get(int index, java.lang.Class<T> parameterType) throws DataConverterException
Values
get
in interface Values
T
- type of the value to getindex
- index of the value in the list of values.parameterType
- class of the value to getDataConverterException
- if value cannot be extracted to the given typepublic <T> T get(int index, java.lang.Class<T> parameterType, java.lang.reflect.Type genericParameterType) throws DataConverterException
Values
TypeToken
) to extract:
TypeToken<List<MyClass>> typeToken = new TypeToken<List<MyClass>>() {};
List<MyClass> result = value.get(List.class, typeToken.getType());
get
in interface Values
T
- type of the value to getindex
- index of the value in the list of values.parameterType
- class of the value to getgenericParameterType
- the type of the value to getDataConverterException
- if value cannot be extracted to the given type