Java Reflection Primitive convertWrapperToPrimitive(Class clazz)

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

Description

convert Wrapper To Primitive

License

Open Source License

Declaration

public static Class<?> convertWrapperToPrimitive(Class<?> clazz) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

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

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

    public static Class<?> convertWrapperToPrimitive(Class<?> clazz) {
        Class<?> result = clazz;

        if (!clazz.isPrimitive()) {

            return wrapperPrimitiveClasses.get(clazz.getName());
        }/*w w w.  ja va  2s.c o  m*/

        return result;
    }
}

Related

  1. castToPrimitive(Object start, Class prim)
  2. convertPrimitiveToObjectClass(Class clazz)
  3. convertPrimitiveToWrapper(Class clazz)
  4. convertPrimitiveToWrapper(Class clazz)
  5. convertToPrimitive(Class type)
  6. createDefaultPrimitive(Class type)
  7. getBENameByPrimitiveClassName( String implementClassName)
  8. getDefaultPrimitiveValue(Class clazz)
  9. getDefaultValue(Class primitive)