Here you can find the source of getPrimitiveWrapper(Class> c)
Parameter | Description |
---|---|
c | The class. |
public static Class<?> getPrimitiveWrapper(Class<?> c)
//package com.java2s; // * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * import java.util.*; public class Main { private final static Map<Class<?>, Class<?>> pmap1 = new HashMap<Class<?>, Class<?>>(), pmap2 = new HashMap<Class<?>, Class<?>>(); /**// w ww .j av a 2s .co m * If the specified class is a primitive (e.g. <code><jk>int</jk>.<jk>class</jk></code>) * returns it's wrapper class (e.g. <code>Integer.<jk>class</jk></code>). * * @param c The class. * @return The wrapper class, or <jk>null</jk> if class is not a primitive. */ public static Class<?> getPrimitiveWrapper(Class<?> c) { return pmap1.get(c); } }