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 Type
    Method
    Description
    Includes the error message for the constraint
    boolean
    isValid(Object value)
    Indicates if the given value is valid or not
  • Method Details

    • isValid

      boolean isValid(Object value)

      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