private static void checkRatingGreaterThanOperator(@Nullable String value, List<String> errors) { check(isNullOrEmpty(value) || !Objects.equals(toRating(value), E), errors, "There's no worse rating than E (%s)", value); }
private static void checkOperator(MetricDto metric, String operator, List<String> errors) { check( Condition.Operator.isValid(operator) && isAllowedOperator(operator, metric), errors, "Operator %s is not allowed for this metric.", operator ); }
private static void validateMetric(MetricDto metric, List<String> errors) { check(isAlertable(metric), errors, "Metric '%s' cannot be used to define a condition.", metric.getKey()); }
private static void checkThresholds(@Nullable String warningThreshold, @Nullable String errorThreshold, List<String> errors) { check(warningThreshold != null || errorThreshold != null, errors, "At least one threshold (warning, error) must be set."); }
private static void checkPeriod(MetricDto metric, @Nullable Integer period, List<String> errors) { if (period == null) { check(!metric.getKey().startsWith("new_"), errors, "A period must be selected for differential metrics."); } else { check(period == 1, errors, "The only valid quality gate period is 1, the leak period."); } }
private static void checkRatingGreaterThanOperator(@Nullable String value, List<String> errors) { check(isNullOrEmpty(value) || !Objects.equals(toRating(value), E), errors, "There's no worse rating than E (%s)", value); }
private static void validateMetric(MetricDto metric, List<String> errors) { check(isAlertable(metric), errors, "Metric '%s' cannot be used to define a condition.", metric.getKey()); }
private static void checkOperator(MetricDto metric, String operator, List<String> errors) { ValueType valueType = valueOf(metric.getValueType()); check(isOperatorAllowed(operator, valueType), errors, "Operator %s is not allowed for metric type %s.", operator, metric.getValueType()); }