package cz.senslog.analytics.utils.newvalidator;

import org.apache.logging.log4j.util.Strings;

import java.util.Optional;

class InstantNotifyTrigger implements NotifyTrigger {

    @Override
    public Optional<NotifyReport> accept(ValidationResult validationResult) {
        if (validationResult.hasViolation()) {
            return Optional.of(new NotifyReport(
                    validationResult.violatedValue(),
                    validationResult.violatedAttribute(),
                    "Inside " + validationResult
            ));
        }
        return Optional.empty();
    }
}