Here you can find the source of isPrimitiveWrapper(final Class> type)
Parameter | Description |
---|---|
type | The class to query or null. |
public static boolean isPrimitiveWrapper(final Class<?> type)
//package com.java2s; //License from project: Open Source License import java.util.HashMap; import java.util.Map; public class Main { /**/* ww w. j av a 2 s .co m*/ * Maps wrapper {@code Class}es to their corresponding primitive types. */ private static final Map<Class<?>, Class<?>> wrapperPrimitiveMap = new HashMap<Class<?>, Class<?>>(); /** * Returns whether the given {@code type} is a primitive wrapper ({@link Boolean}, {@link Byte}, {@link Character}, {@link Short}, * {@link Integer}, {@link Long}, {@link Double}, {@link Float}). * * @param type * The class to query or null. * @return true if the given {@code type} is a primitive wrapper ({@link Boolean}, {@link Byte}, {@link Character}, {@link Short}, * {@link Integer}, {@link Long}, {@link Double}, {@link Float}). * @since 3.1 */ public static boolean isPrimitiveWrapper(final Class<?> type) { return wrapperPrimitiveMap.containsKey(type); } }