public static boolean allfieldIsNUll(Object o){ try{ for(Field field:o.getClass().getDeclaredFields()){ field.setAccessible(true);//把私有属性公有化 Object object = field.get(o); if(object instanceof CharSequence){ if(!ObjectUtils.isEmpty((String)object)){ return false; } }else{ if(!ObjectUtils.isNUll(object)){ return false; } } } }catch (Exception e){ e.printStackTrace(); } return true; }