package link.at17.mid.tushare.data.validator;

import jakarta.validation.ConstraintValidatorContext;

/**
 * 快速提供自定义错误信息返回
 */
public interface IValidator {
    
    public default boolean invalid(ConstraintValidatorContext context, String message) {
        context.disableDefaultConstraintViolation();
        context.buildConstraintViolationWithTemplate(message)
               .addConstraintViolation();
        return false;
    }

}
