Interface Values
- All Known Implementing Classes:
EncodedValues
public interface Values
Value that can be extracted to an appropriate type.
-
Method Summary
Modifier and TypeMethodDescription<T> TGet value of the specified type.<T> TGet value of the specified generic type.default <T> TThe same asget(int, Class)with 0 index.default <T> TThe same asget(int, Class, Type)with 0 index.intgetSize()
-
Method Details
-
getSize
int getSize() -
get
The same asget(int, Class)with 0 index.- Throws:
DataConverterException
-
get
Get 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
The same asget(int, Class, Type)with 0 index.- Throws:
DataConverterException
-
get
<T> T get(int index, Class<T> parameterType, Type genericParameterType) throws DataConverterException 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());- 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
-