Here you can find the source of getPrimitiveClass(Class> wrapperClazz)
public static Class<?> getPrimitiveClass(Class<?> wrapperClazz)
//package com.java2s; /* /* w ww . jav a2 s .c o m*/ Copyright (C) 2013 Raquel Pau and Albert Coroleu. Walkmod is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Walkmod is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with Walkmod. If not, see <http://www.gnu.org/licenses/>.*/ import java.util.HashMap; import java.util.Map; public class Main { private static Map<String, Class<?>> primitiveClasses = new HashMap<String, Class<?>>(); private static Map<String, String> wrapperClasses = new HashMap<String, String>(); public static Class<?> getPrimitiveClass(Class<?> wrapperClazz) { if (isPrimitiveWrapperClass(wrapperClazz)) { return getPrimitiveClass(wrapperClasses.get(wrapperClazz.getName())); } return null; } public static Class<?> getPrimitiveClass(String name) { return primitiveClasses.get(name); } public static boolean isPrimitiveWrapperClass(Class<?> clazz) { return wrapperClasses.containsKey(clazz.getName()); } }