public void validate()

in log4j-catalog/log4j-catalog-api/src/main/java/org/apache/logging/log4j/catalog/api/plugins/MaxValueConstraint.java [32:60]


    public void validate(boolean isRequestContext, String name, String value, String maxValue, StringBuilder error) {
        if (isBlank(maxValue)) {
            appendNewline(error);
            if (isRequestContext) {
                error.append("ThreadContext key ");
            }
            error.append(name).append(" has no value for the minimum value defined");
            return;
        }
        if (!isBlank(value)) {
            try {
                BigDecimal minVal = new BigDecimal(maxValue);
                BigDecimal val = new BigDecimal(value);
                if (val.compareTo(minVal) > 0) {
                    appendNewline(error);
                    if (isRequestContext) {
                        error.append("ThreadContext key ");
                    }
                    error.append(name).append(" is less than ").append(maxValue);
                }
            } catch (Exception ex) {
                appendNewline(error);
                if (isRequestContext) {
                    error.append("ThreadContext key ");
                }
                error.append(name).append(" encountered an error trying to determine the minimum value: ").append(ex.getMessage());
            }
        }
    }