Java Reflection Primitive primitiveToWrapper(final Class cls)

Here you can find the source of primitiveToWrapper(final Class cls)

Description

primitive To Wrapper

License

Apache License

Declaration

public static Class<?> primitiveToWrapper(final Class<?> cls) 

Method Source Code

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

import java.util.HashMap;
import java.util.Map;

public class Main {
    private static final Map<Class<?>, Class<?>> primitiveWrapperMap = new HashMap<Class<?>, Class<?>>();

    public static Class<?> primitiveToWrapper(final Class<?> cls) {
        Class<?> convertedClass = cls;

        if (cls != null && cls.isPrimitive()) {
            convertedClass = primitiveWrapperMap.get(cls);
        }//  w w w  .java  2  s.  c  om

        return convertedClass;
    }
}

Related

  1. isWrapperClass(Class clazz)
  2. isWrapperType(Class type)
  3. matchPrimitive(Class paramType, Object arg)
  4. primitiveArraysForName(String className)
  5. primitiveToWrapper(final Class cls)
  6. resolveClassPrimitiveAware(String className)
  7. resolvePrimitiveClassName(String name)
  8. resolvePrimitiveClassName(String name)
  9. resolvePrimitiveIfNecessary(Class clazz)