Interface Constraint
- All Known Implementing Classes:
ExistInConstraint, GroupConstraint, LengthConstraint, NotConstraint, NumericConstraint, RegexConstraint
public interface Constraint
To perform validation we add a constraint to a validator, a constraint defines whether a value if valid
for a given object
-
Method Summary
Modifier and TypeMethodDescriptionIncludes the error message for the constraintbooleanIndicates if the given value is valid or not
-
Method Details
-
isValid
Indicates if the given value is valid or not
Parameters
value: the value for the object
Returns
true if the value is valid and false otherwise
-
getDefaultFailMessage
String getDefaultFailMessage()Includes the error message for the constraint
Returns
the text of the error message for a constraint
-