public class NotConstraint

  1. Object
  2. 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

children Constraint...
the child constraints

NotConstraint

public NotConstraint(String failMessage, Constraint... children)
Creates a new NotConstraint

Parameters

failMessage String
the default error message if the constraint fails
children Constraint...
the child constraints

Method details

isValid

public boolean isValid(Object value)
Indicates if the given value is valid or not

Parameters

value Object
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