public interface Validator<T>
Modifier and Type | Method and Description |
---|---|
default Validator |
and(Validator other)
Returns a validator that represents a short-circuiting logical AND of this
validator and another.
|
boolean |
isValid(T value)
Validates the value according to the constraints defined by this validator.
|
default Validator |
negate()
Returns a validator that represents the logical negation of this validator.
|
default Validator |
or(Validator other)
Returns a validator that represents a short-circuiting logical OR of this
validator and another.
|
boolean isValid(T value)
value
- the value to validatetrue
if the value is valid, false
otherwise.default Validator and(Validator other)
other
- the validator to composedefault Validator or(Validator other)
other
- the validator to composedefault Validator negate()