is Field String Type - Android java.lang.reflect

Android examples for java.lang.reflect:Field

Description

is Field String Type

Demo Code


//package com.java2s;

import java.lang.reflect.Field;

public class Main {
    public static boolean isStringType(Field field) {
        return isStringType(getFeildClass(field));
    }/*from  w ww. j  ava2s. com*/

    public static boolean isStringType(Class<?> type) {
        if (type == String.class) {
            return true;
        }
        return false;
    }

    public static Class<?> getFeildClass(Field field) {
        return field.getType();
    }
}

Related Tutorials