final class NumberToNumberConverterFactory extends java.lang.Object implements ConverterFactory<java.lang.Number,java.lang.Number>, ConditionalConverter
Support Number classes including Byte, Short, Integer, Float, Double, Long, BigInteger, BigDecimal. This class
delegates to NumberUtils.convertNumberToTargetClass(Number, Class)
to perform the conversion.
Byte
,
Short
,
Integer
,
Long
,
BigInteger
,
Float
,
Double
,
BigDecimal
,
NumberUtils
Modifier and Type | Class and Description |
---|---|
private static class |
NumberToNumberConverterFactory.NumberToNumber<T extends java.lang.Number> |
Constructor and Description |
---|
NumberToNumberConverterFactory() |
Modifier and Type | Method and Description |
---|---|
<T extends java.lang.Number> |
getConverter(java.lang.Class<T> targetType)
Get the converter to convert from S to target type T, where T is also an instance of R.
|
boolean |
matches(TypeDescriptor sourceType,
TypeDescriptor targetType)
Should the conversion from
sourceType to targetType currently under
consideration be selected? |
public <T extends java.lang.Number> Converter<java.lang.Number,T> getConverter(java.lang.Class<T> targetType)
ConverterFactory
getConverter
in interface ConverterFactory<java.lang.Number,java.lang.Number>
T
- the target typetargetType
- the target type to convert topublic boolean matches(TypeDescriptor sourceType, TypeDescriptor targetType)
ConditionalConverter
sourceType
to targetType
currently under
consideration be selected?matches
in interface ConditionalConverter
sourceType
- the type descriptor of the field we are converting fromtargetType
- the type descriptor of the field we are converting to