Java Reflection Primitive isPrimitiveClass(String className)

Here you can find the source of isPrimitiveClass(String className)

Description

Determine whether the class of the specified className is a primitive type class

License

Apache License

Parameter

Parameter Description
className the class's name

Return

whether the class of the specified className is a primitive type class

Declaration

public static boolean isPrimitiveClass(String className) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.HashMap;

import java.util.Map;

public class Main {
    private static Map primitiveClassMap = new HashMap();

    /**//  w w w . j a va  2s  . c o m
     * Determine whether the class of the specified className is a primitive
     * type class
     * 
     * @param className
     *            the class's name
     * @return whether the class of the specified className is a primitive type
     *         class
     */
    public static boolean isPrimitiveClass(String className) {
        if (className != null && primitiveClassMap.containsKey(className)) {
            return true;
        } else {
            return false;
        }
    }
}

Related

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