Java Class to Primitive getPrimitiveTypeByWrapper(Class clazz)

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

Description

get Primitive Type By Wrapper

License

Apache License

Declaration

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

Method Source Code

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

import java.util.*;

public class Main {
    /**//from   w ww .  j a  va 2s  . co  m
     * Map with primitive wrapper type as key and corresponding primitive type
     * as value, for example: Integer.class -> int.class.
     */
    private static final Map<Class<?>, Class<?>> wrapperPrimitiveTypeMap = new HashMap<Class<?>, Class<?>>(8);

    public static Class<?> getPrimitiveTypeByWrapper(Class<?> clazz) {
        return wrapperPrimitiveTypeMap.get(clazz);
    }
}

Related

  1. getPrimitiveClass(String name)
  2. getPrimitiveDftValue(Class clazz)
  3. getPrimitiveWrapper(Class c)
  4. getWrapper(String primitiveClassName)
  5. getWrapperTypeByPrimitive(Class clazz)
  6. primitiveToWrapper(Class cls)