code: public static boolean isEmpty(Entity<?> entity, boolean ignoreDefault) {
      try {
        for (final String attr : PropertyUtils.getWritableProperties(entity.getClass())) {
          Object value = PropertyUtils.getProperty(entity, attr);
          if (null == value) continue;
          if (ignoreDefault) {
            if (value instanceof Number) {
              if (((Number) value).intValue() != 0) { return false; }
            } else if (value instanceof String) {
              String str = (String) value;
              if (Strings.isNotEmpty(str)) { return false; }
            } else {
              return false;
            }
          } else {
            return false;
          }
        }
      } catch (Exception e) {
        logger.error("isEmpty error", e);
      }
      return true;
    }
docs: 判断实体类中的属性是否全部为空
  
  @param entity a {@link org.beangle.commons.entity.Entity} object.
  @param ignoreDefault
  忽略数字和字符串的默认值
  @return a boolean.