public interface Values
Modifier and Type | Method and Description |
---|---|
default <T> T |
get(java.lang.Class<T> parameterType)
The same as
get(int, Class) with 0 index. |
default <T> T |
get(java.lang.Class<T> parameterType,
java.lang.reflect.Type genericParameterType)
The same as
get(int, Class, Type) with 0 index. |
<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() |
int getSize()
default <T> T get(java.lang.Class<T> parameterType) throws DataConverterException
get(int, Class)
with 0 index.DataConverterException
<T> T get(int index, java.lang.Class<T> parameterType) throws DataConverterException
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 typedefault <T> T get(java.lang.Class<T> parameterType, java.lang.reflect.Type genericParameterType) throws DataConverterException
get(int, Class, Type)
with 0 index.DataConverterException
<T> T get(int index, java.lang.Class<T> parameterType, java.lang.reflect.Type genericParameterType) throws DataConverterException
TypeToken
) to extract:
TypeToken<List<MyClass>> typeToken = new TypeToken<List<MyClass>>() {};
List<MyClass> result = value.get(List.class, typeToken.getType());
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