package cz.senslog.analytics.utils.validator.domain;

import cz.senslog.analytics.domain.Threshold;

public record ThresholdValidationResult(Threshold threshold, ValidationResult[] validationResults) {

    public boolean isViolated() {
        boolean notValid = validationResults[0].isNotValid();
        for (int i = 1; i < validationResults.length; i++) {
            notValid = notValid && validationResults[i].isNotValid();
        }
        return notValid;
    }
}
