Package io.temporal.common.converter
Class EncodedValues
- java.lang.Object
-
- io.temporal.common.converter.EncodedValues
-
-
Constructor Summary
Constructors Constructor Description EncodedValues(java.lang.Object... values)
EncodedValues(java.util.Optional<io.temporal.api.common.v1.Payloads> payloads, DataConverter converter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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()
-
-
-
Constructor Detail
-
EncodedValues
public EncodedValues(java.util.Optional<io.temporal.api.common.v1.Payloads> payloads, DataConverter converter)
-
EncodedValues
public EncodedValues(java.lang.Object... values)
-
-
Method Detail
-
toPayloads
public java.util.Optional<io.temporal.api.common.v1.Payloads> toPayloads()
-
setDataConverter
public void setDataConverter(DataConverter converter)
-
get
public <T> T get(int index, java.lang.Class<T> parameterType) throws DataConverterException
Description copied from interface:Values
Get value of the specified type.- Specified by:
get
in interfaceValues
- Type Parameters:
T
- type of the value to get- Parameters:
index
- index of the value in the list of values.parameterType
- class of the value to get- Returns:
- value or null
- Throws:
DataConverterException
- if value cannot be extracted to the given type
-
get
public <T> T get(int index, java.lang.Class<T> parameterType, java.lang.reflect.Type genericParameterType) throws DataConverterException
Description copied from interface:Values
Get value of the specified generic type. For example if value is of type Listuse the following expression (using TypeToken
) to extract:TypeToken<List<MyClass>> typeToken = new TypeToken<List<MyClass>>() {}; List<MyClass> result = value.get(List.class, typeToken.getType());
- Specified by:
get
in interfaceValues
- Type Parameters:
T
- type of the value to get- Parameters:
index
- index of the value in the list of values.parameterType
- class of the value to getgenericParameterType
- the type of the value to get- Returns:
- value or null
- Throws:
DataConverterException
- if value cannot be extracted to the given type
-
-