java.lang.Object
org.litebridgedb.convert.converter.BigDecimalConverter
- All Implemented Interfaces:
Converter<BigDecimal>,ConverterFunction<BigDecimal>,SqlConverter<BigDecimal>
A converter for
BigDecimal values.
Handles Types.NUMERIC and Types.DECIMAL.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable BigDecimalConverts the given value to aBigDecimal.int[]sqlTypes()Returns the SQL types associated with this converter.Class<?> type()Returns the target Java class this converter handles.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.litebridgedb.convert.converter.Converter
primitiveType
-
Constructor Details
-
BigDecimalConverter
public BigDecimalConverter()
-
-
Method Details
-
convert
Converts the given value to aBigDecimal.Supports various numeric types and string representation as fall-back.
- Specified by:
convertin interfaceConverterFunction<BigDecimal>- Parameters:
value- the value to convert, may benull- Returns:
- the converted
BigDecimal, ornull
-
type
Returns the target Java class this converter handles.- Specified by:
typein interfaceConverter<BigDecimal>- Returns:
BigDecimal.class
-
sqlTypes
public int[] sqlTypes()Returns the SQL types associated with this converter.- Specified by:
sqlTypesin interfaceSqlConverter<BigDecimal>- Returns:
- an array containing
Types.NUMERICandTypes.DECIMAL
-