play.api.data.mapping

GenericRules

trait GenericRules extends AnyRef

GenericRules provides basic constraints, utility methods on Rules, and completely generic Rules. Extends this trait if your implementing a new set of Rules.

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. GenericRules
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. implicit def arrayR[I, O](implicit arg0: ClassTag[O], r: RuleLike[I, O]): Rule[Seq[I], Array[O]]

    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
    r

    A Rule[I, O] to lift

    returns

    A new Rule

  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def checked[I](implicit b: RuleLike[I, Boolean]): Rule[I, Boolean]

    A Rule for HTML checkboxes

  9. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. def email: Rule[String, String]

    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
  11. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  12. def equalTo[T](t: T): Rule[T, T]

    Create a Rule of equality

    Create a Rule of equality

    (Path \ "foo").read(equalTo("bar"))
  13. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  16. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  17. implicit def headAs[I, O](implicit c: RuleLike[I, O]): Rule[Seq[I], O]

    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))
  18. def ignored[I, O](o: O): (Path) ⇒ Rule[I, O]

    Create a "constant" Rule which is always a success returning value o (Path \ "x").

    Create a "constant" Rule which is always a success returning value o (Path \ "x").read(ignored(42))

  19. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  20. implicit def listR[I, O](implicit r: RuleLike[I, O]): Rule[Seq[I], List[O]]

    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
    r

    A Rule[I, O] to lift

    returns

    A new Rule

  21. def max[T](m: T)(implicit o: Ordering[T]): Rule[T, T]

    (Path \ "foo").read(max(0)) // validate that there's a negative int at (Path \ "foo")
  22. def maxLength(l: Int): Rule[String, String]

    (Path \ "foo").read(maxLength(5)) // The length of this String must be <= 5
  23. def min[T](m: T)(implicit o: Ordering[T]): Rule[T, T]

    (Path \ "foo").read(min(0)) // validate that there's a positive int at (Path \ "foo")
  24. def minLength(l: Int): Rule[String, String]

    (Path \ "foo").read(minLength(5)) // The length of this String must be >= 5
  25. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  26. def noConstraint[From]: (From) ⇒ Validation[ValidationError, From]

    A Rule that always succeed

  27. def not[I, O](r: RuleLike[I, O]): Rule[I, I]

  28. def notEmpty: Rule[String, String]

    a Rule validating that a String is not empty.

    a Rule validating that a String is not empty.

    Note

    This Rule does NOT trim the String beforehand

    (Path \ "foo").read(notEmpty)
  29. final def notify(): Unit

    Definition Classes
    AnyRef
  30. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  31. def pattern(regex: Regex): Rule[String, String]

    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
  32. implicit def seqR[I, O](implicit r: RuleLike[I, O]): Rule[Seq[I], Seq[O]]

    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
    r

    A Rule[I, O] to lift

    returns

    A new Rule

  33. implicit def setR[I, O](implicit r: RuleLike[I, O]): Rule[Seq[I], Set[O]]

    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
    r

    A Rule[I, O] to lift

    returns

    A new Rule

  34. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  35. def toString(): String

    Definition Classes
    AnyRef → Any
  36. implicit def traversableR[I, O](implicit r: RuleLike[I, O]): Rule[Seq[I], Traversable[O]]

    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
    r

    A Rule[I, O] to lift

    returns

    A new Rule

  37. def validateWith[I](msg: String, args: Any*)(pred: (I) ⇒ Boolean): Rule[I, I]

    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 }
    msg

    The error message to return if predicate pred is not satisfied

    args

    Arguments for the ValidationError

    pred

    A predicate to satify

    returns

    A new Rule validating data of type I against a predicate p

  38. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  40. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped