Java Class Type Check isPrimitiveType(Class clazz)

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

Description

is Primitive Type

License

Apache License

Declaration

public static boolean isPrimitiveType(Class<?> clazz) 

Method Source Code

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

import java.util.*;

public class Main {
    public static boolean isPrimitiveType(Class<?> clazz) {
        if (clazz != null) {
            return clazz.isPrimitive() || clazz.isEnum() || Number.class.isAssignableFrom(clazz)
                    || String.class.isAssignableFrom(clazz) || Boolean.class.isAssignableFrom(clazz)
                    || Character.class.isAssignableFrom(clazz) || Date.class.isAssignableFrom(clazz);
        }//from w  w  w . j  av  a  2 s.c  o m

        return false;
    }
}

Related

  1. isMethodReturnTypeValid(Class cls)
  2. isNumber(Class type)
  3. isNumberType(Class type)
  4. isNumeralType(final Class c)
  5. isPrimitive(Class c)
  6. isPrimitiveType(String className)
  7. isPrimitiveWrapper(Class clazz)
  8. isPrimitiveWrapper(Class type)
  9. isSimpleClass(Class clazz)