类 CompatibleTypeUtils


  • public class CompatibleTypeUtils
    extends Object
    • 方法详细资料

      • compatibleTypeConvert

        public static Object compatibleTypeConvert(Object value,
                                                   Class<?> type)
        Compatible type convert. Null value is allowed to pass in. If no conversion is needed, then the original value will be returned.

        Supported compatible type conversions include (primary types and corresponding wrappers are not listed):

        • String -> char, enum, Date
        • byte, short, int, long -> byte, short, int, long
        • float, double -> float, double