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