lift a Rule[I, O]
to a Rule of Rule[Seq[I], Array[O]]
lift a Rule[I, O]
to a Rule of Rule[Seq[I], Array[O]]
(Path \ "foo").read(array(notEmpty)) // create a Rules validating that an Array contains non-empty Strings
A Rule[I, O] to lift
A new Rule
A Rule for HTML checkboxes
A Rule for HTML checkboxes
Validate that a String is a valid email
Validate that a String is a valid email
(Path \ "email").read(email) // This String is an email
Create a Rule of equality
Create a Rule of equality
(Path \ "foo").read(equalTo("bar"))
Create a Rule validation that a Seq[I] is not empty, and attempt to convert it's first element as a O
Create a Rule validation that a Seq[I] is not empty, and attempt to convert it's first element as a O
(Path \ "foo").read(headAs(int))
Create a "constant" Rule which is always a success returning value o
(Path \ "x").read(ignored(42))
Create a "constant" Rule which is always a success returning value o
(Path \ "x").read(ignored(42))
lift a Rule[I, O]
to a Rule of Rule[Seq[I], List[O]]
lift a Rule[I, O]
to a Rule of Rule[Seq[I], List[O]]
(Path \ "foo").read(list(notEmpty)) // create a Rules validating that an List contains non-empty Strings
A Rule[I, O] to lift
A new Rule
(Path \ "foo").read(max(0)) // validate that there's a negative int at (Path \ "foo")
(Path \ "foo").read(maxLength(5)) // The length of this String must be <= 5
(Path \ "foo").read(min(0)) // validate that there's a positive int at (Path \ "foo")
(Path \ "foo").read(minLength(5)) // The length of this String must be >= 5
A Rule that always succeed
A Rule that always succeed
a Rule validating that a String is not empty.
a Rule validating that a String is not empty.
This Rule does NOT trim the String beforehand
(Path \ "foo").read(notEmpty)
Validate that a String matches the provided regex
Validate that a String matches the provided regex
(Path \ "foo").read(pattern("[a-z]".r)) // This String contains only letters
lift a Rule[I, O]
to a Rule of Rule[Seq[I], Seq[O]]
lift a Rule[I, O]
to a Rule of Rule[Seq[I], Seq[O]]
(Path \ "foo").read(seq(notEmpty)) // create a Rules validating that an Seq contains non-empty Strings
A Rule[I, O] to lift
A new Rule
lift a Rule[I, O]
to a Rule of Rule[Seq[I], Set[O]]
lift a Rule[I, O]
to a Rule of Rule[Seq[I], Set[O]]
(Path \ "foo").read(set(notEmpty)) // create a Rules validating that a Set contains non-empty Strings
A Rule[I, O] to lift
A new Rule
lift a Rule[I, O]
to a Rule of Rule[Seq[I], Traversable[O]]
lift a Rule[I, O]
to a Rule of Rule[Seq[I], Traversable[O]]
(Path \ "foo").read(traversable(notEmpty)) // create a Rules validating that an Traversable contains non-empty Strings
A Rule[I, O] to lift
A new Rule
Create a new constraint, verifying that the provided predicate is satisfied.
Create a new constraint, verifying that the provided predicate is satisfied.
def notEmpty = validateWith[String]("validation.nonemptytext"){ !_.isEmpty }
The error message to return if predicate pred
is not satisfied
Arguments for the ValidationError
A predicate to satify
A new Rule validating data of type I
against a predicate p