K - the type of the keyT - the type of the valuepublic final class CsvMapConverter<K,T> extends Object implements CsvPropertyConverter<T>
| Constructor and Description |
|---|
CsvMapConverter() |
| Modifier and Type | Method and Description |
|---|---|
T |
convert(Class<? extends T> targetType,
String value)
Converts a value from CSV to Java.
|
static <N extends Number,V> |
create(Map<N,V> map,
Class<N> numberClass)
Creates a new instance of a CsvMapConverter that uses numbers to lookup the values.
|
static <V> CsvMapConverter<String,V> |
create(Map<String,V> map)
Creates a new instance of a CsvMapConverter that uses strings to lookup the values.
|
public static <N extends Number,V> CsvMapConverter<N,V> create(Map<N,V> map, Class<N> numberClass)
map - mapping from the number to the valuesnumberClass - the concrete class of the numberspublic static <V> CsvMapConverter<String,V> create(Map<String,V> map)
map - mapping from the string to the valuepublic T convert(Class<? extends T> targetType, String value)
CsvPropertyConverterconvert in interface CsvPropertyConverter<T>targetType - the type of the target propertyvalue - the value in CSVCopyright © 2016 fastnate.org. All rights reserved.