class NotificationValueValidator implements ConstraintValidator<ValidNotificationValue, NotificationRow> {

    @Override
    public boolean isValid(NotificationRow value, ConstraintValidatorContext context) {
        if (!isValid(value)) {
            context.disableDefaultConstraintViolation();
            context.buildConstraintViolationWithTemplate(WRONG_EXPIRES_AT_EXPRESSION)
                    .addConstraintViolation();
            return false;
        }
        return true;
    }

}