com.apamatesoft.validator.Rule Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Validator Show documentation
Show all versions of Validator Show documentation
Facilitates the validation of Strings by chaining a series of rules
package com.apamatesoft.validator;
import com.apamatesoft.validator.functions.Validate;
public class Rule {
private final String message;
private final Validate validate;
public Rule(String message, Validate validate) {
this.validate = validate;
this.message = message;
}
public boolean validate(String evaluate) {
return validate.invoke(evaluate);
}
public String getMessage() {
return message;
}
}