All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cq.json.util.ClassUtil Maven / Gradle / Ivy

The newest version!
package cq.json.util;

public class ClassUtil
{   
    //将基础数据类型转换成包装类型
    public static Class enca(Class clazz){
        if(clazz == int.class){
            clazz = Integer.class;
        }else if(clazz == double.class){
            clazz = Double.class;
        }else if(clazz == float.class){
            clazz = Float.class;
        }else if(clazz == char.class){
            clazz = Character.class;
        }else if(clazz == byte.class){
            clazz = Byte.class;
        }else if(clazz == long.class){
            clazz = Long.class;
        }else if(clazz == boolean.class){
            clazz = Boolean.class;
        }else if(clazz == short.class){
            clazz = Short.class;
        }
        return clazz;  
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy