Java Reflection Primitive getWrapper(Class clazz)

Here you can find the source of getWrapper(Class clazz)

Description

get Wrapper

License

Apache License

Declaration

public static Class getWrapper(Class clazz) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Map;

public class Main {
    private static Map<Class, Class> wrappers;

    public static Class getWrapper(Class clazz) {
        if (isPrimitive(clazz)) {
            return wrappers.get(clazz);
        }/*w  ww  . j  a va  2 s .  c o m*/
        return clazz;
    }

    public static boolean isPrimitive(Class clazz) {
        return wrappers.containsKey(clazz);
    }
}

Related

  1. getPrimitiveSize(Class type)
  2. getPrimitiveType(Class clazz)
  3. getPrimitiveType(String javaClassName)
  4. getPrimitiveWrapper(Class primitiveType)
  5. getRank(Class aNumberClass)
  6. getWrapper(Class type)
  7. getWrapper(final Class beanClass)
  8. getWrapperClass(Class clazz)
  9. getWrapperClass(Class primitiveClass)