Java tutorial
//package com.java2s; import java.lang.reflect.Field; public class Main { private static boolean equalsType(Field type, Class<?>... cls) { for (int i = 0; i < cls.length; i++) { Class<?> mClass = cls[i]; if (type.getType().getCanonicalName().equals(mClass.getName())) { return true; } } return false; } }