Interface CSVConverter<T>
- Type Parameters:
T
- the type which should be converted to a String or created by parsing an input String.
- All Known Implementing Classes:
BigDecimalConverter
,CharacterConverter
,CSVDateConverter
,CSVUtilDateConverter
,EnumConverter
,IntegerConverter
,ListConverter
,UtilDateConverter
public interface CSVConverter<T>
Interface for implementing a converter for type
T
.
Conversion in both directions has to be implemented.
-
Method Details
-
convert
Convert a value to a String representation. It should be lossless, so that back conversion is possible without loss of information. However, this is not required.- Parameters:
value
- the value of TypeT
to convert. May benull
- Returns:
- a String representation e.g.
Object.toString()
-
parse
Parse a String value to retrieve an object of typeT
.- Parameters:
value
- the String representation coming from a CSV file.- Returns:
- the converted object.
- Throws:
CSVConversionException
- if there is a problem while parsing the input, e.g. if the format is not recognized.
-