Class CSVDateConverter<T extends TemporalAccessor>
java.lang.Object
me.landmesser.simplecsv.converter.CSVDateConverter<T>
- All Implemented Interfaces:
CSVConverter<TemporalAccessor>
public class CSVDateConverter<T extends TemporalAccessor> extends Object implements CSVConverter<TemporalAccessor>
-
Constructor Summary
Constructors Constructor Description CSVDateConverter(Class<T> type, String format)
-
Method Summary
Modifier and Type Method Description String
convert(TemporalAccessor value)
Convert a value to a String representation.TemporalAccessor
parse(String value)
Parse a String value to retrieve an object of typeT
.
-
Constructor Details
-
Method Details
-
convert
Description copied from interface:CSVConverter
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.- Specified by:
convert
in interfaceCSVConverter<T extends TemporalAccessor>
- Parameters:
value
- the value of TypeT
to convert. May benull
- Returns:
- a String representation e.g.
Object.toString()
-
parse
Description copied from interface:CSVConverter
Parse a String value to retrieve an object of typeT
.- Specified by:
parse
in interfaceCSVConverter<T extends TemporalAccessor>
- 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.
-