trait ConstraintReads extends AnyRef
- Source
- JsConstraints.scala
- Alphabetic
- By Inheritance
- ConstraintReads
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- def email(implicit reads: Reads[String]): Reads[String]
- def filter[A](otherwise: JsonValidationError)(p: (A) => Boolean)(implicit reads: Reads[A]): Reads[A]
- def filterNot[A](error: JsonValidationError)(p: (A) => Boolean)(implicit reads: Reads[A]): Reads[A]
- def list[A](implicit reads: Reads[A]): Reads[List[A]]
- def map[A](implicit reads: Reads[A]): Reads[Map[String, A]]
- def max[O](m: O)(implicit reads: Reads[O], ord: Ordering[O]): Reads[O]
Defines a maximum value for a Reads.
Defines a maximum value for a Reads. Combine with
min
usingandKeep
, e.g..read(Reads.min(0.1) andKeep Reads.max(1.0))
. - def maxLength[M](m: Int)(implicit reads: Reads[M], p: (M) => Iterable[_]): Reads[M]
- def min[O](m: O)(implicit reads: Reads[O], ord: Ordering[O]): Reads[O]
Defines a minimum value for a Reads.
Defines a minimum value for a Reads. Combine with
max
usingandKeep
, e.g..read(Reads.min(0) andKeep Reads.max(100))
. - def minLength[M](m: Int)(implicit reads: Reads[M], p: (M) => Iterable[_]): Reads[M]
- def of[A](implicit r: Reads[A]): Reads[A]
The simpler of all Reads that just finds an implicit Reads[A] of the expected type
The simpler of all Reads that just finds an implicit Reads[A] of the expected type
- Annotations
- @inline()
- def optionNoError[A](implicit reads: Reads[A]): Reads[Option[A]]
Stupidly reads a field as an Option mapping any error (format or missing field) to None
- def optionWithNull[T](implicit rds: Reads[T]): Reads[Option[T]]
very simple optional field Reads that maps "null" to None
- def pattern(regex: => Regex, error: String = "error.pattern")(implicit reads: Reads[String]): Reads[String]
Defines a regular expression constraint for
String
values, i.e.Defines a regular expression constraint for
String
values, i.e. the string must match the regular expression pattern - def pure[A](a: => A): Reads[A]
- def seq[A](implicit reads: Reads[A]): Reads[Seq[A]]
- def set[A](implicit reads: Reads[A]): Reads[Set[A]]
- def verifying[A](cond: (A) => Boolean)(implicit rds: Reads[A]): Reads[A]
- def verifyingIf[A](cond: (A) => Boolean)(subreads: Reads[_])(implicit rds: Reads[A]): Reads[A]