package com.njzscloud.common.mvc.validator;


import java.util.function.Supplier;

/**
 * 校验规则
 */
public class ValidRule {
    public final Supplier<Boolean> predicate;
    public final String message;

    private ValidRule(Supplier<Boolean> predicate, String message) {
        this.predicate = predicate;
        this.message = message;
    }

    public static ValidRule of(Supplier<Boolean> predicate, String message) {
        return new ValidRule(predicate, message);
    }
}

