play.api.data

OptionalMapping

case class OptionalMapping [T] (wrapped: Mapping[T], constraints: Seq[Constraint[Option[T]]]) extends Mapping[Option[T]] with Product with Serializable

A mapping for optional elements

wrapped

the wrapped mapping

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

Instance Constructors

  1. new OptionalMapping (wrapped: Mapping[T], constraints: Seq[Constraint[Option[T]]])

    wrapped

    the wrapped 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. def applyConstraints (t: Option[T]): Either[Seq[FormError], Option[T]]

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

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

    Binds this field, i.

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

    data

    the submitted data

    returns

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

    Definition Classes
    OptionalMappingMapping
  10. def canEqual (arg0: Any): Boolean

    Definition Classes
    OptionalMapping → Equals
  11. def clone (): AnyRef

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

    Attributes
    protected
    Definition Classes
    Mapping
  13. val constraints : Seq[Constraint[Option[T]]]

    The constraints associated with this field.

    The constraints associated with this field.

    Definition Classes
    OptionalMappingMapping
  14. def eq (arg0: AnyRef): Boolean

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

    Definition Classes
    OptionalMapping → Equals → AnyRef → Any
  16. def finalize (): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  17. 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
    OptionalMappingMapping
  18. def getClass (): java.lang.Class[_]

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

    Definition Classes
    OptionalMapping → AnyRef → Any
  20. def isInstanceOf [T0] : Boolean

    Attributes
    final
    Definition Classes
    Any
  21. val key : String

    The field key.

    The field key.

    Definition Classes
    OptionalMappingMapping
  22. 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
    OptionalMappingMapping
  23. def ne (arg0: AnyRef): Boolean

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

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

    Attributes
    final
    Definition Classes
    AnyRef
  26. def productArity : Int

    Definition Classes
    OptionalMapping → Product
  27. def productElement (arg0: Int): Any

    Definition Classes
    OptionalMapping → Product
  28. def productIterator : Iterator[Any]

    Definition Classes
    Product
  29. def productPrefix : String

    Definition Classes
    OptionalMapping → Product
  30. def synchronized [T0] (arg0: ⇒ T0): T0

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

    Definition Classes
    OptionalMapping → AnyRef → Any
  32. def transform [B] (f1: (Option[T]) ⇒ B, f2: (B) ⇒ Option[T]): 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
  33. def unbind (value: Option[T]): (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 error if the unbinding failed.

    Definition Classes
    OptionalMappingMapping
  34. def verifying (addConstraints: Constraint[Option[T]]*): Mapping[Option[T]]

    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
    OptionalMappingMapping
  35. def verifying (error: ⇒ String, constraint: (Option[T]) ⇒ Boolean): Mapping[Option[T]]

    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
  36. def verifying (constraint: (Option[T]) ⇒ Boolean): Mapping[Option[T]]

    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
  37. def wait (): Unit

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

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

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  40. def withPrefix (prefix: String): Mapping[Option[T]]

    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
    OptionalMappingMapping
  41. val wrapped : Mapping[T]

    the wrapped mapping

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 Mapping[Option[T]]

Inherited from AnyRef

Inherited from Any