Package io.temporal.common.converter
Interface Values
-
- All Known Implementing Classes:
EncodedValues
public interface ValuesValue that can be extracted to an appropriate type.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description <T> Tget(int index, java.lang.Class<T> parameterType)Get value of the specified type.<T> Tget(int index, java.lang.Class<T> parameterType, java.lang.reflect.Type genericParameterType)Get value of the specified generic type.default <T> Tget(java.lang.Class<T> parameterType)The same asget(int, Class)with 0 index.default <T> Tget(java.lang.Class<T> parameterType, java.lang.reflect.Type genericParameterType)The same asget(int, Class, Type)with 0 index.intgetSize()
-
-
-
Method Detail
-
getSize
int getSize()
-
get
default <T> T get(java.lang.Class<T> parameterType) throws DataConverterExceptionThe same asget(int, Class)with 0 index.- Throws:
DataConverterException
-
get
<T> T get(int index, java.lang.Class<T> parameterType) throws DataConverterExceptionGet value of the specified type.- 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
default <T> T get(java.lang.Class<T> parameterType, java.lang.reflect.Type genericParameterType) throws DataConverterExceptionThe same asget(int, Class, Type)with 0 index.- Throws:
DataConverterException
-
get
<T> T get(int index, java.lang.Class<T> parameterType, java.lang.reflect.Type genericParameterType) throws DataConverterExceptionGet 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());- 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
-
-