public static boolean isField(Object object)throws Exception{ boolean flag = true; Class materual = (Class) object.getClass(); Field [] fs = materual.getDeclaredFields(); for (Field f :fs){ f.setAccessible(true); Object val = f.get(object); if (val!=null){ flag = false; break; } } return flag; }
java判断一个对象是否全部为空
最新推荐文章于 2022-10-11 17:48:18 发布