类 NumberToNumberConverterFactory

java.lang.Object
cn.taketoday.core.conversion.support.NumberToNumberConverterFactory
所有已实现的接口:
ConditionalConverter, ConverterFactory<Number,Number>

final class NumberToNumberConverterFactory extends Object implements ConverterFactory<Number,Number>, ConditionalConverter
Converts from any JDK-standard Number implementation to any other JDK-standard Number implementation.

Support Number classes including Byte, Short, Integer, Float, Double, Long, BigInteger, BigDecimal. This class delegates to NumberUtils.convertNumberToTargetClass(Number, Class) to perform the conversion.

从以下版本开始:
3.0
作者:
Keith Donald
另请参阅:
  • 构造器详细资料

    • NumberToNumberConverterFactory

      NumberToNumberConverterFactory()
  • 方法详细资料

    • getConverter

      public <T extends Number> Converter<Number,T> getConverter(Class<T> targetType)
      从接口复制的说明: ConverterFactory
      Get the converter to convert from S to target type T, where T is also an instance of R.
      指定者:
      getConverter 在接口中 ConverterFactory<Number,Number>
      类型参数:
      T - the target type
      参数:
      targetType - the target type to convert to
      返回:
      a converter from S to T
    • matches

      public boolean matches(TypeDescriptor sourceType, TypeDescriptor targetType)
      从接口复制的说明: ConditionalConverter
      Should the conversion from sourceType to targetType currently under consideration be selected?
      指定者:
      matches 在接口中 ConditionalConverter
      参数:
      sourceType - the type descriptor of the field we are converting from
      targetType - the type descriptor of the field we are converting to
      返回:
      true if conversion should be performed, false otherwise