Here you can find the source of primitiveToWrapper(final Class> p)
Parameter | Description |
---|---|
p | class suppose to be a primitive |
public static Class<?> primitiveToWrapper(final Class<?> p)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { /**//w w w . j a v a2 s . c o m * lookup map for matching primitive types and their object wrappers. */ private static final Map<Class<?>, Class<?>> PRIMITIVES_TO_WRAPPERS = new HashMap<>(); /** * Returns referenced wrapper for primitive type. * * @param p class suppose to be a primitive * @return wrapper for primitive, {@code null} if passed type is not a * primitive */ public static Class<?> primitiveToWrapper(final Class<?> p) { return PRIMITIVES_TO_WRAPPERS.get(p); } }