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;
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-02-24
  • 2021-10-16
  • 2022-12-23
  • 2021-12-07
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-27
  • 2021-10-16
  • 2022-12-23
  • 2022-02-05
  • 2022-12-23
相关资源
相似解决方案