play.api.data

ObjectMapping1

case class ObjectMapping1 [R, A1] (apply: (A1) ⇒ R, unapply: (R) ⇒ Option[A1], f1: (String, Mapping[A1]), key: String, constraints: Seq[Constraint[R]]) extends Mapping[R] with ObjectMapping with Product with Serializable

Represents an object binding (ie. a binding for several fields).

This is used for objects with one field. Other versions exist, e.g. ObjectMapping2, ObjectMapping3, etc.

apply

a constructor function that creates a instance of T using field A

constraints

constraints associated with this mapping

Linear Supertypes
Serializable, Serializable, Product, Equals, ObjectMapping, Mapping[R], AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. ObjectMapping1
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. ObjectMapping
  7. Mapping
  8. AnyRef
  9. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ObjectMapping1 (apply: (A1) ⇒ R, unapply: (R) ⇒ Option[A1], f1: (String, Mapping[A1]), key: String, constraints: Seq[Constraint[R]])

    apply

    a constructor function that creates a instance of T using field A

    constraints

    constraints associated with this mapping

Value Members

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

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

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

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

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

    Attributes
    final
    Definition Classes
    Any
  6. def addPrefix (prefix: String): Option[String]

    Attributes
    protected
    Definition Classes
    Mapping
  7. val apply : (A1) ⇒ R

    a constructor function that creates a instance of T using field A

  8. def applyConstraints (t: R): Either[Seq[FormError], R]

    Attributes
    protected
    Definition Classes
    Mapping
  9. def asInstanceOf [T0] : T0

    Attributes
    final
    Definition Classes
    Any
  10. def bind (data: Map[String, String]): Either[Seq[FormError], R]

    Binds this field, i.

    Binds this field, i.e. construct a concrete value from submitted data.

    data

    the submitted data

    returns

    either a concrete value of type T or a set of errors, if the binding failed

    Definition Classes
    ObjectMapping1Mapping
  11. def canEqual (arg0: Any): Boolean

    Definition Classes
    ObjectMapping1 → Equals
  12. def clone (): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  13. def collectErrors (t: R): Seq[FormError]

    Attributes
    protected
    Definition Classes
    Mapping
  14. val constraints : Seq[Constraint[R]]

    constraints associated with this mapping

    constraints associated with this mapping

    Definition Classes
    ObjectMapping1Mapping
  15. def eq (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  16. def equals (arg0: Any): Boolean

    Definition Classes
    ObjectMapping1 → Equals → AnyRef → Any
  17. val f1 : (String, Mapping[A1])

  18. val field1 : Mapping[A1]

  19. def finalize (): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  20. val format : Option[(String, Seq[Any])]

    The Format expected for this field, if it exists.

    The Format expected for this field, if it exists.

    Definition Classes
    Mapping
  21. def getClass (): java.lang.Class[_]

    Attributes
    final
    Definition Classes
    AnyRef → Any
  22. def hashCode (): Int

    Definition Classes
    ObjectMapping1 → AnyRef → Any
  23. def isInstanceOf [T0] : Boolean

    Attributes
    final
    Definition Classes
    Any
  24. val key : String

    The field key.

    The field key.

    Definition Classes
    ObjectMapping1Mapping
  25. val mappings : Seq[play.api.data.Mapping[_]]

    Sub-mappings (these can be seen as sub-keys).

    Sub-mappings (these can be seen as sub-keys).

    Definition Classes
    ObjectMapping1Mapping
  26. def merge (results: Either[Seq[FormError], Any]*): Either[Seq[FormError], Seq[Any]]

    Merges the result of multiple bindings.

    Merges the result of multiple bindings.

    Definition Classes
    ObjectMapping
    See also

    bind()

  27. def merge2 (a: Either[Seq[FormError], Seq[Any]], b: Either[Seq[FormError], Seq[Any]]): Either[Seq[FormError], Seq[Any]]

    Merges the result of two bindings.

    Merges the result of two bindings.

    Definition Classes
    ObjectMapping
    See also

    bind()

  28. def ne (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  29. def notify (): Unit

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

    Attributes
    final
    Definition Classes
    AnyRef
  31. def productArity : Int

    Definition Classes
    ObjectMapping1 → Product
  32. def productElement (arg0: Int): Any

    Definition Classes
    ObjectMapping1 → Product
  33. def productIterator : Iterator[Any]

    Definition Classes
    Product
  34. def productPrefix : String

    Definition Classes
    ObjectMapping1 → Product
  35. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  36. def toString (): String

    Definition Classes
    ObjectMapping1 → AnyRef → Any
  37. def transform [B] (f1: (R) ⇒ B, f2: (B) ⇒ R): Mapping[B]

    Transform this Mapping[T] to a Mapping[B].

    Transform this Mapping[T] to a Mapping[B].

    B

    The type of the new mapping.

    f1

    Transform value of T to a value of B

    f2

    Transform value of B to a value of T

    Definition Classes
    Mapping
  38. val unapply : (R) ⇒ Option[A1]

  39. def unbind (value: R): (Map[String, String], Seq[FormError])

    Unbinds this field, i.

    Unbinds this field, i.e. transforms a concrete value to plain data.

    value

    the value to unbind

    returns

    either the plain data or a set of errors, if the unbinding failed

    Definition Classes
    ObjectMapping1Mapping
  40. def verifying (addConstraints: Constraint[R]*): ObjectMapping1[R, A1]

    Constructs a new Mapping based on this one, by adding new constraints.

    Constructs a new Mapping based on this one, by adding new constraints.

    For example:

      import play.api.data._
      import validation.Constraints._
    
      Form("phonenumber" -> text.verifying(required) )
    
    returns

    the new mapping

    Definition Classes
    ObjectMapping1Mapping
  41. def verifying (error: ⇒ String, constraint: (R) ⇒ Boolean): Mapping[R]

    Constructs a new Mapping based on this one, by adding a new ad-hoc constraint.

    Constructs a new Mapping based on this one, by adding a new ad-hoc constraint.

    For example:

      import play.api.data._
      import validation.Constraints._
    
      Form("phonenumber" -> text.verifying("Bad phone number", {_.grouped(2).size == 5}))
    
    error

    The error message used if the constraint fails

    constraint

    a function describing the constraint that returns false on failure

    returns

    the new mapping

    Definition Classes
    Mapping
  42. def verifying (constraint: (R) ⇒ Boolean): Mapping[R]

    Constructs a new Mapping based on this one, by adding a new ad-hoc constraint.

    Constructs a new Mapping based on this one, by adding a new ad-hoc constraint.

    For example:

      import play.api.data._
      import validation.Constraints._
    
      Form("phonenumber" -> text.verifying {_.grouped(2).size == 5})
    
    constraint

    a function describing the constraint that returns false on failure

    returns

    the new mapping

    Definition Classes
    Mapping
  43. def wait (): Unit

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

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

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  46. def withPrefix (prefix: String): ObjectMapping1[R, A1]

    Constructs a new Mapping based on this one, adding a prefix to the key.

    Constructs a new Mapping based on this one, adding a prefix to the key.

    prefix

    the prefix to add to the key

    returns

    the same mapping, with only the key changed

    Definition Classes
    ObjectMapping1Mapping

Deprecated Value Members

  1. def productElements : Iterator[Any]

    Definition Classes
    Product
    Annotations
    @deprecated
    Deprecated

    use productIterator instead

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from ObjectMapping

Inherited from Mapping[R]

Inherited from AnyRef

Inherited from Any