Support Number classes including Byte, Short, Integer, Float, Double, Long, BigInteger, BigDecimal. This class
delegates to NumberUtils#convertNumberToTargetClass(Number, Class) to perform the conversion.
java.lang.Byte , java.lang.Short , java.lang.Integer , java.lang.Long , java.math.BigInteger , java.lang.Float , java.lang.Double , java.math.BigDecimal , NumberUtils
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public <T extends Number> Converter | getConverter(Class<T>
the target type to convert to targetType)Implements org. Get the converter to convert from S to target type T, where T is also an instance of R. |
| public boolean | matches(TypeDescriptor
the type descriptor of the field we are converting from sourceType, TypeDescriptor the type descriptor of the field we are converting to targetType)Implements org. Should the conversion from |
| NumberToNumberConverterFactory | back to summary |
|---|---|
| pack-priv NumberToNumberConverterFactory() | |
| getConverter | back to summary |
|---|---|
| public <T extends Number> Converter Implements org. Doc from org. Get the converter to convert from S to target type T, where T is also an instance of R. | |
| matches | back to summary |
|---|---|
| public boolean matches(TypeDescriptor sourceType, TypeDescriptor targetType) Implements org. Doc from org. Should the conversion from
| |
| Modifier and Type | Field and Description |
|---|---|
| private final Class |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public T | convert(Number
the source object to convert, which must be an instance of source)S (never null)Implements org. Convert the source object of type |
| targetType | back to summary |
|---|---|
| private final Class<T> targetType | |
| NumberToNumber | back to summary |
|---|---|
| pack-priv NumberToNumber(Class<T> targetType) | |
| convert | back to summary |
|---|---|
| public T convert(Number source) Implements org. Doc from org. Convert the source object of type | |