Package com.oorian.data.converter
Class StringToBigDecimalConverter
java.lang.Object
com.oorian.data.converter.StringToBigDecimalConverter
- All Implemented Interfaces:
Converter<String,BigDecimal>
Converts between
String and BigDecimal.- Since:
- 2.1
- Version:
- 1.0
- Author:
- Marvin P. Warble Jr.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new converter with the default error message.StringToBigDecimalConverter(String errorMessage) Creates a new converter with a custom error message. -
Method Summary
Modifier and TypeMethodDescriptionconvertToModel(String value) Converts a presentation value to its model representation.convertToPresentation(BigDecimal value) Converts a model value to its presentation representation.
-
Constructor Details
-
StringToBigDecimalConverter
public StringToBigDecimalConverter()Creates a new converter with the default error message. -
StringToBigDecimalConverter
Creates a new converter with a custom error message.- Parameters:
errorMessage- the error message shown when conversion fails
-
-
Method Details
-
convertToModel
Description copied from interface:ConverterConverts a presentation value to its model representation.- Specified by:
convertToModelin interfaceConverter<String,BigDecimal> - Parameters:
value- the presentation value to convert (may be null)- Returns:
- the model value
- Throws:
ConversionException- if conversion fails
-
convertToPresentation
Description copied from interface:ConverterConverts a model value to its presentation representation.- Specified by:
convertToPresentationin interfaceConverter<String,BigDecimal> - Parameters:
value- the model value to convert (may be null)- Returns:
- the presentation value
-