类 ConvertUtils


  • public class ConvertUtils
    extends Object
    • 构造器详细资料

      • ConvertUtils

        public ConvertUtils()
    • 方法详细资料

      • canConvert

        public static <T,​S> boolean canConvert​(S source,
                                                     Class<T> targetType)
      • convert

        public static <T,​S> T convert​(S source,
                                            Class<T> targetType)
      • convert

        public static <T,​S> T convert​(S source,
                                            Class<T> targetType,
                                            T defaultValue)
        执行转型操作
        类型参数:
        T - TargetType
        S - SourceType
        参数:
        source - sourceObject
        targetType - targetType
        defaultValue - 默认值
        返回:
        TargetObject