Java Class Type Check isBasicType(Class clazz)

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

Description

is Basic Type

License

Apache License

Declaration

public static boolean isBasicType(Class<?> clazz) 

Method Source Code

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

import java.util.*;

public class Main {
    public static boolean isBasicType(Class<?> clazz) {
        return !Collection.class.isAssignableFrom(clazz)
                && (clazz.equals(Integer.class)
                        || clazz.equals(Integer.TYPE)
                        || clazz.equals(Long.class)
                        || clazz.equals(Long.TYPE)
                        || clazz.equals(Boolean.class)
                        || clazz.equals(Boolean.TYPE)
                        || clazz.equals(Float.class)
                        || clazz.equals(Float.TYPE)
                        || clazz.equals(Double.class)
                        || clazz.equals(Double.TYPE)
                        || clazz.equals(Byte.class)
                        || clazz.equals(Byte.TYPE)
                        || clazz.equals(String.class) || Date.class
                            .isAssignableFrom(clazz));

    }//  www .j a  va2 s  .c om
}

Related

  1. isAssignable(final Class target, final Class source)
  2. isAssignableFrom(Class clazzA, Class clazzB)
  3. isClassBelowPackage(Class theClass, List packageList)
  4. isCollection(Class clazz)
  5. isCollection(Class cls)
  6. isCollectionMapOrArray(Class type)