Java Reflection Primitive isPrimitiveOrWrapper(final Class type)

Here you can find the source of isPrimitiveOrWrapper(final Class type)

Description

is Primitive Or Wrapper

License

Apache License

Declaration

public static boolean isPrimitiveOrWrapper(final Class<?> type) 

Method Source Code


//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);
    }
}

Related

  1. isPrimitiveClass(String primitiveClassName)
  2. isPrimitiveClassName(String cls)
  3. isPrimitiveOrPrimitiveWrapper(final Class type)
  4. isPrimitiveOrWrapper(Class klass)
  5. isPrimitiveOrWrapper(Class type)
  6. isPrimitiveWrapper(Class clazz)
  7. isPrimitiveWrapper(Class clazz)
  8. isPrimitiveWrapper(Class klass)
  9. isPrimitiveWrapper(final Class type)