is Base Data Type - Android java.lang.reflect

Android examples for java.lang.reflect:Base Type

Description

is Base Data Type

Demo Code


//package com.java2s;

import java.util.Date;

public class Main {

    public static boolean isBaseDataType(Class<?> clazz) {
        return clazz.isPrimitive() || clazz.equals(String.class)
                || clazz.equals(Boolean.class)
                || clazz.equals(Integer.class) || clazz.equals(Long.class)
                || clazz.equals(Float.class) || clazz.equals(Double.class)
                || clazz.equals(Byte.class)
                || clazz.equals(Character.class)
                || clazz.equals(Short.class) || clazz.equals(Date.class)
                || clazz.equals(byte[].class) || clazz.equals(Byte[].class);
    }//w ww . ja v a  2  s.  com
}

Related Tutorials