ConstraintReads

play.api.libs.json.ConstraintReads

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Reads.type

Members list

Value members

Concrete methods

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. Combine with min using andKeep, e.g. .read(Reads.min(0.1) andKeep Reads.max(1.0)).

Defines a maximum value for a Reads. Combine with min using andKeep, e.g. .read(Reads.min(0.1) andKeep Reads.max(1.0)).

Attributes

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. Combine with max using andKeep, e.g. .read(Reads.min(0) andKeep Reads.max(100)).

Defines a minimum value for a Reads. Combine with max using andKeep, e.g. .read(Reads.min(0) andKeep Reads.max(100)).

Attributes

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

Attributes

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

Stupidly reads a field as an Option mapping any error (format or missing field) to None

Attributes

def optionWithNull[T](implicit rds: Reads[T]): Reads[Option[T]]

very simple optional field Reads that maps "null" to None

very simple optional field Reads that maps "null" to None

Attributes

def pattern(regex: => Regex, error: String)(implicit reads: Reads[String]): Reads[String]

Defines a regular expression constraint for String values, i.e. the string must match the regular expression pattern

Defines a regular expression constraint for String values, i.e. the string must match the regular expression pattern

Attributes

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]