A combinator that takes a chain of predicates and implements logical AND between them.
A combinator that takes a chain of predicates and implements logical AND between them.
The type on which this validator operates.
A validator that succeeds only if the validated object is equal to the specified value.
A validator that succeeds only if the validated object is equal to the specified value. Respects nulls and delegates equality checks to java.lang.Object.equals.
A validator that always fails with a specific violation.
A validator that always fails with a specific violation.
The type on which this validator operates.
A validator that succeeds only if the provided object is not null
.
A validator that succeeds only if the provided object is null
.
A validator that always succeeds.
A validator that always succeeds.
The type on which this validator operates.
A validator that succeeds only if the validated object is not equal to the specified value.
A validator that succeeds only if the validated object is not equal to the specified value. Respects nulls and delegates equality checks to java.lang.Object.equals.
A combinator that takes a chain of predicates and implements logical OR between them.
A combinator that takes a chain of predicates and implements logical OR between them. When all predicates fail, a com.wix.accord.GroupViolation is produced; the predicates comprise the group's children.
The type on which this validator operates.
A validator which merely delegates to another, implicitly available validator.
A validator which merely delegates to another, implicitly available validator. This is necessary for the description generation to work correctly, e.g. in the case where:
case class Person( firstName: String, lastName: String )
case class Classroom( teacher: Person, students: Seq[ Person ] )
implicit val personValidator = validator[ Person ] { p => p.firstName is notEmpty p.lastName is notEmpty }
implicit val classValidator = validator[ Classroom ] { c =>
c.teacher is valid
c.students.each is valid
c.students have size > 0
}
c.teacher
actually delegates to the personValidator
, which means a correct error message would be
a com.wix.accord.GroupViolation aggregating the actual rule violations.
The object type this validator operates on. An implicit com.wix.accord.Validator
over type T
must be in scope.
Non type-specific combinators.