Here you can find the source of isWrapperOfPrimitiveType(Class> primitiveType, Class> otherType)
private static boolean isWrapperOfPrimitiveType(Class<?> primitiveType, Class<?> otherType)
//package com.java2s; /*// w w w.j av a 2 s. co m * Copyright (c) 2006-2012 Rog?rio Liesenfeld * This file is subject to the terms of the MIT license (see LICENSE.txt). */ import java.util.*; public class Main { private static final Map<Class<?>, Class<?>> WRAPPER_TO_PRIMITIVE = new HashMap<Class<?>, Class<?>>() { { put(Boolean.class, boolean.class); put(Character.class, char.class); put(Byte.class, byte.class); put(Short.class, short.class); put(Integer.class, int.class); put(Float.class, float.class); put(Long.class, long.class); put(Double.class, double.class); } }; private static boolean isWrapperOfPrimitiveType(Class<?> primitiveType, Class<?> otherType) { return primitiveType == WRAPPER_TO_PRIMITIVE.get(otherType); } public static boolean isWrapperOfPrimitiveType(Class<?> type) { return WRAPPER_TO_PRIMITIVE.containsKey(type); } }