code: public void expectMax(String name, double maxLength, String message) {
          String value = Optional.ofNullable(get(name)).orElse("");
  
          if (StringUtils.isNumeric(value)) {
              if (Double.parseDouble(value) > maxLength) {
                  addError(name, Optional.ofNullable(message).orElse(messages.get(Validation.MAX_KEY.name(), name, maxLength)));
              }
          } else {
              if (value.length() > maxLength) {
                  addError(name, Optional.ofNullable(message).orElse(messages.get(Validation.MAX_KEY.name(), name, maxLength)));
              }
          }
      }
docs: Validates a given field to have a maximum length
  
  @param name The field to check
  @param maxLength The maximum length
  @param message A custom error message instead of the default one