jetbrick-commons/src/main/java/jetbrick/beans/ClassUtils.java
public static boolean isAssignable(Class<?> lhs, Class<?> rhs) {
        if (lhs == null) return false;
        if (rhs == null) return (!(lhs.isPrimitive()));

        if (unboxed_class_set.contains(lhs)) {
            lhs = boxed_class_map.get(lhs);
        }
        if (unboxed_class_set.contains(rhs)) {
            rhs = boxed_class_map.get(rhs);
        }
        if (lhs.isAssignableFrom(rhs)) {
            return true;
        }

        lhs = unboxed_class_map.get(lhs);
        rhs = unboxed_class_map.get(rhs);
        if (lhs == null || rhs == null) {
            return false;
        }
        if (Integer.TYPE.equals(rhs)) {
            return (Long.TYPE.equals(lhs) || Float.TYPE.equals(lhs) || Double.TYPE.equals(lhs));
        }
        if (Long.TYPE.equals(rhs)) {
            return (Float.TYPE.equals(lhs) || Double.TYPE.equals(lhs));
        }
        if (Float.TYPE.equals(rhs)) {
            return Double.TYPE.equals(lhs);
        }
        if (Double.TYPE.equals(rhs)) {
            return false;
        }
        if (Boolean.TYPE.equals(rhs)) {
            return false;
        }
        if (Byte.TYPE.equals(rhs)) {
            return (Short.TYPE.equals(lhs) || Integer.TYPE.equals(lhs) || Long.TYPE.equals(lhs) || Float.TYPE.equals(lhs) || Double.TYPE.equals(lhs));
        }
        if (Short.TYPE.equals(rhs)) {
            return (Integer.TYPE.equals(lhs) || Long.TYPE.equals(lhs) || Float.TYPE.equals(lhs) || Double.TYPE.equals(lhs));
        }
        if (Character.TYPE.equals(rhs)) {
            return (Integer.TYPE.equals(lhs) || Long.TYPE.equals(lhs) || Float.TYPE.equals(lhs) || Double.TYPE.equals(lhs));
        }
        return false;
    }
public static boolean isAssignable(Class<?> lhs, Class<?> rhs) {
        if (lhs == null) return false;
        if (rhs == null) return (!(lhs.isPrimitive()));

        if (unboxed_class_set.contains(lhs)) {
            lhs = boxed_class_map.get(lhs);
        }
        if (unboxed_class_set.contains(rhs)) {
            rhs = boxed_class_map.get(rhs);
        }
        if (lhs.isAssignableFrom(rhs)) {
            return true;
        }

        lhs = unboxed_class_map.get(lhs);
        rhs = unboxed_class_map.get(rhs);
        if (lhs == null || rhs == null) {
            return false;
        }
        if (Integer.TYPE.equals(rhs)) {
            return (Long.TYPE.equals(lhs) || Float.TYPE.equals(lhs) || Double.TYPE.equals(lhs));
        }
        if (Long.TYPE.equals(rhs)) {
            return (Float.TYPE.equals(lhs) || Double.TYPE.equals(lhs));
        }
        if (Float.TYPE.equals(rhs)) {
            return Double.TYPE.equals(lhs);
        }
        if (Double.TYPE.equals(rhs)) {
            return false;
        }
        if (Boolean.TYPE.equals(rhs)) {
            return false;
        }
        if (Byte.TYPE.equals(rhs)) {
            return (Short.TYPE.equals(lhs) || Integer.TYPE.equals(lhs) || Long.TYPE.equals(lhs) || Float.TYPE.equals(lhs) || Double.TYPE.equals(lhs));
        }
        if (Short.TYPE.equals(rhs)) {
            return (Integer.TYPE.equals(lhs) || Long.TYPE.equals(lhs) || Float.TYPE.equals(lhs) || Double.TYPE.equals(lhs));
        }
        if (Character.TYPE.equals(rhs)) {
            return (Integer.TYPE.equals(lhs) || Long.TYPE.equals(lhs) || Float.TYPE.equals(lhs) || Double.TYPE.equals(lhs));
        }
        return false;
    }
Class.isAssignableFrom() 的增强版本。 支持 null, 自动装箱,
以及数字类型的隐私转换.