Here you can find the source of isPrimitiveOrWrapper(final Class> type)
public static boolean isPrimitiveOrWrapper(final Class<?> type)
//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<?>> wrapperPrimitiveMap = new HashMap<Class<?>, Class<?>>(); public static boolean isPrimitiveOrWrapper(final Class<?> type) { if (type == null) { return false; }//from w w w . ja v a 2 s . c o m return type.isPrimitive() || isPrimitiveWrapper(type); } public static boolean isPrimitiveWrapper(final Class<?> type) { return wrapperPrimitiveMap.containsKey(type); } }