Java tutorial
//package com.java2s; import java.lang.reflect.Field; import android.text.TextUtils; public class Main { public static boolean isFiledWithName(Field field, String fieldName) { if (field == null || TextUtils.isEmpty(fieldName)) { throw new IllegalArgumentException("params is illegal"); } if (fieldName.equals(field.getName())) { return true; } return false; } }