Java Reflection Primitive isPrimitiveClass(Class clazz)

Here you can find the source of isPrimitiveClass(Class clazz)

Description

Determines whether the given clazz is a primitive class.

License

Apache License

Parameter

Parameter Description
clazz a parameter

Declaration

public static boolean isPrimitiveClass(Class<?> clazz) 

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<?>> primitiveToObjectClassMap = new HashMap<Class<?>, Class<?>>();

    /**/*from   w  ww  . java  2  s .  c o  m*/
     * Determines whether the given clazz is a primitive class.
     *
     * @param clazz
     * @return
     */
    public static boolean isPrimitiveClass(Class<?> clazz) {
        return primitiveToObjectClassMap.containsKey(clazz);
    }
}

Related

  1. isNumeric(Class operandClass)
  2. isNumericPrimitive(Class type)
  3. isNumericType(Class aNumberClass)
  4. isPrimitive(Class c)
  5. isPrimitive(Class clazz)
  6. isPrimitiveClass(Class cls)
  7. isPrimitiveClass(String className)
  8. isPrimitiveClass(String primitiveClassName)
  9. isPrimitiveClassName(String cls)