code: public void expectRange(String name, int minLength, int maxLength, String message) {
          String value = Optional.ofNullable(get(name)).orElse("");
  
          if (StringUtils.isNumeric(value)) {
              double doubleValue = Double.parseDouble(value);
              if (doubleValue < minLength || doubleValue > maxLength) {
                  addError(name, Optional.ofNullable(message).orElse(messages.get(Validation.RANGE_KEY.name(), name, minLength, maxLength)));
              }
          } else {
              if (value.length() < minLength || value.length() > maxLength) {
                  addError(name, Optional.ofNullable(message).orElse(messages.get(Validation.RANGE_KEY.name(), name, minLength, maxLength)));
              }
          }
      }
docs: Validates a field to be in a certain range
  
  @param name The field to check
  @param minLength The minimum length
  @param maxLength The maximum length
  @param message A custom error message instead of the default one