An Accord validator is a typeclass, which adds data validation rules over an existing
domain model. The api module deals with the usage site; details on how to define validators can be found
in the core module.
To use a validator, simply import this package, make sure the validator is in scope and use the
validate function:
scala> import com.wix.accord._
import com.wix.accord._
scala> import MyDomain._
import MyDomain._
scala> val person = Person( name = "Niklaus", surname = "Wirth", age = 81 )
person: MyDomain.Person = Person(Niklaus,Wirth,81)
scala> validate( person )
res0: com.wix.accord.Result = Success
The entry-point to the Accord library.
Overview
An Accord validator is a typeclass, which adds data validation rules over an existing domain model. The
api
module deals with the usage site; details on how to define validators can be found in thecore
module.To use a validator, simply import this package, make sure the validator is in scope and use the validate function:
See Result, Success and Failure for details of the result model.