根据反射机制获取对象的所有属性,然后立flag,判断每个属性是否都是null
Fields fields = obj.getClass().getDeclaredFields;标签:obj,get,对象,field,flag,null,属性 From: https://www.cnblogs.com/threeboke/p/17306842.html
boolean flag = false;
for(Field field:fields){
field.setAccessible(true);
if (field.get(obj) != null && StringUtils.isNotBlank(field.get(obj).toString())) {
flag = true;
}