An object representing a failed validation result.
An object representing a failed validation result.
The violations that caused the validation to fail.
Describes the violation of a group of constraints.
Describes the violation of a group of constraints. For example, the com.wix.accord.combinators.Or combinator produces a group violation when all predicates fail.
The value of the object which failed the validation rule.
A textual description of the constraint being violated (for example, "must not be empty").
The textual description of the object under validation.
The set of violations contained within the group.
A base trait for validation results.
A base trait for validation results.
Describes the violation of a validation rule or constraint.
Describes the violation of a validation rule or constraint.
The value of the object which failed the validation rule.
A textual description of the constraint being violated (for example, "must not be empty").
The textual description of the object under validation.
A validator is a function T => Result
, where T
is the type of the object under validation
and Result is an instance of com.wix.accord.Result.
A validator is a function T => Result
, where T
is the type of the object under validation
and Result is an instance of com.wix.accord.Result.
Implementation note: While theoretically a validator can be defined as a type alias, in practice this doesn't allow to specify an error message when it's implicitly missing at the call site (see scala.annotation.implicitNotFound).
The object type this validator operates on.
A base trait for all violation types.
Provides alternative syntax for validation.
Provides alternative syntax for validation. Instead of having to explicitly call
com.wix.accord.validate, an object can be validated by calling
instanceUnderTest.validate
. This is strictly an aesthetic preference, there are
no differences in implementation or execution.
An object representing a successful validation result.
Validates the specified object and returns a validation com.wix.accord.Result.
Validates the specified object and returns a validation com.wix.accord.Result. An implicit com.wix.accord.Validator must be in scope for this call to succeed.
The type of the object to validate.
The object to validate.
A validator for objects of type T
.
A com.wix.accord.Result indicating success or failure of the validation.
The entry-point to the Accord library. To execute a validator, simply import it into the local scope, import this package and execute
validate( objectUnderValidation )
.