public class NotConstraint
- Object
- NotConstraint
ImplementsConstraint
Negates a group of constraints, such that, if any of its child constraints is true, it returns false.
Constructors
public NotConstraint(Constraint... children) | Creates a new NotConstraint |
public NotConstraint(String failMessage, Constraint... children) | Creates a new NotConstraint |
Methods
public boolean isValid(Object value) | Indicates if the given value is valid or not |
public String getDefaultFailMessage() | Includes the error message for the constraint |
Inherited methods
Constructor details
NotConstraint
public NotConstraint(Constraint... children)Creates a new NotConstraint
Parameters
childrenConstraint...- the child constraints
NotConstraint
public NotConstraint(String failMessage, Constraint... children)Creates a new NotConstraint
Parameters
failMessageString- the default error message if the constraint fails
childrenConstraint...- the child constraints
Method details
isValid
public boolean isValid(Object value)Indicates if the given value is valid or not
Parameters
valueObject- the value for the object
Returns
true if the value is valid and false otherwise
getDefaultFailMessage
public String getDefaultFailMessage()Includes the error message for the constraint
Returns
the text of the error message for a constraint