ObjectMapping19

play.api.data.ObjectMapping19
class ObjectMapping19[R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19](apply: (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19) => R, unapply: R => Option[(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19)], f1: (String, Mapping[A1]), f2: (String, Mapping[A2]), f3: (String, Mapping[A3]), f4: (String, Mapping[A4]), f5: (String, Mapping[A5]), f6: (String, Mapping[A6]), f7: (String, Mapping[A7]), f8: (String, Mapping[A8]), f9: (String, Mapping[A9]), f10: (String, Mapping[A10]), f11: (String, Mapping[A11]), f12: (String, Mapping[A12]), f13: (String, Mapping[A13]), f14: (String, Mapping[A14]), f15: (String, Mapping[A15]), f16: (String, Mapping[A16]), f17: (String, Mapping[A17]), f18: (String, Mapping[A18]), f19: (String, Mapping[A19]), val key: String, val constraints: Seq[Constraint[R]]) extends Mapping[R], ObjectMapping

Attributes

Graph
Supertypes
trait Mapping[R]
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def bind(data: Map[String, String]): Either[Seq[FormError], R]

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

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

Value parameters

data

the submitted data

Attributes

Returns

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

def unbind(value: R): Map[String, String]

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

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

Value parameters

value

the value to unbind

Attributes

Returns

the plain data

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

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

Value parameters

value

the value to unbind

Attributes

Returns

the plain data and any errors in the plain data

def verifying(addConstraints: Constraint[R]*): ObjectMapping19[R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19]

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) )

Value parameters

constraints

the constraints to add

Attributes

Returns

the new mapping

def withPrefix(prefix: String): ObjectMapping19[R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19]

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.

Value parameters

prefix

the prefix to add to the key

Attributes

Returns

the same mapping, with only the key changed

Inherited methods

protected def addPrefix(prefix: String): Option[String]

Attributes

Inherited from:
Mapping
protected def applyConstraints(t: R): Either[Seq[FormError], R]

Attributes

Inherited from:
Mapping
protected def collectErrors(t: R): Seq[FormError]

Attributes

Inherited from:
Mapping
def format: Option[(String, Seq[Any])]

The Format expected for this field, if it exists.

The Format expected for this field, if it exists.

Attributes

Inherited from:
Mapping
def merge(results: Either[Seq[FormError], Any]*): Either[Seq[FormError], Seq[Any]]

Merges the result of multiple bindings.

Merges the result of multiple bindings.

Attributes

See also

bind()

Inherited from:
ObjectMapping
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.

Attributes

See also

bind()

Inherited from:
ObjectMapping
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].

Type parameters

B

The type of the new mapping.

Value parameters

f1

Transform value of T to a value of B

f2

Transform value of B to a value of T

Attributes

Inherited from:
Mapping
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}))

Value parameters

constraint

a function describing the constraint that returns false on failure

error

The error message used if the constraint fails

Attributes

Returns

the new mapping

Inherited from:
Mapping
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})

Value parameters

constraint

a function describing the constraint that returns false on failure

Attributes

Returns

the new mapping

Inherited from:
Mapping

Concrete fields

The constraints associated with this field.

The constraints associated with this field.

Attributes

val field1: Mapping[A1]
val field10: Mapping[A10]
val field11: Mapping[A11]
val field12: Mapping[A12]
val field13: Mapping[A13]
val field14: Mapping[A14]
val field15: Mapping[A15]
val field16: Mapping[A16]
val field17: Mapping[A17]
val field18: Mapping[A18]
val field19: Mapping[A19]
val field2: Mapping[A2]
val field3: Mapping[A3]
val field4: Mapping[A4]
val field5: Mapping[A5]
val field6: Mapping[A6]
val field7: Mapping[A7]
val field8: Mapping[A8]
val field9: Mapping[A9]
val key: String

The field key.

The field key.

Attributes

val mappings: Seq[Mapping[_]]

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

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

Attributes