class ObjectMapping2[R, A1, A2] extends Mapping[R] with ObjectMapping
- Source
- ObjectMappings.scala
- Alphabetic
- By Inheritance
- ObjectMapping2
- ObjectMapping
- Mapping
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new ObjectMapping2(apply: (A1, A2) ⇒ R, unapply: (R) ⇒ Option[(A1, A2)], f1: (String, Mapping[A1]), f2: (String, Mapping[A2]), key: String = "", constraints: Seq[Constraint[R]] = Nil)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
addPrefix(prefix: String): Option[String]
- Attributes
- protected
- Definition Classes
- Mapping
-
def
applyConstraints(t: R): Either[Seq[FormError], R]
- Attributes
- protected
- Definition Classes
- Mapping
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
bind(data: Map[String, String]): Either[Seq[FormError], R]
Binds this field, i.e.
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
- ObjectMapping2 → Mapping
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
collectErrors(t: R): Seq[FormError]
- Attributes
- protected
- Definition Classes
- Mapping
-
val
constraints: Seq[Constraint[R]]
The constraints associated with this field.
The constraints associated with this field.
- Definition Classes
- ObjectMapping2 → Mapping
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val field1: Mapping[A1]
- val field2: Mapping[A2]
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
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
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
val
key: String
The field key.
The field key.
- Definition Classes
- ObjectMapping2 → Mapping
-
val
mappings: Seq[Mapping[_]]
Sub-mappings (these can be seen as sub-keys).
Sub-mappings (these can be seen as sub-keys).
- Definition Classes
- ObjectMapping2 → 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.
- Definition Classes
- ObjectMapping
- See also
bind()
-
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()
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
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
-
def
unbind(value: R): Map[String, String]
Unbinds this field, i.e.
Unbinds this field, i.e. transforms a concrete value to plain data.
- value
the value to unbind
- returns
the plain data
- Definition Classes
- ObjectMapping2 → Mapping
-
def
unbindAndValidate(value: R): (Map[String, String], Seq[FormError])
Unbinds this field, i.e.
Unbinds this field, i.e. transforms a concrete value to plain data, and applies validation.
- value
the value to unbind
- returns
the plain data and any errors in the plain data
- Definition Classes
- ObjectMapping2 → Mapping
-
def
verifying(addConstraints: Constraint[R]*): ObjectMapping2[R, A1, A2]
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
- ObjectMapping2 → 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}))
- 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
-
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
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
withPrefix(prefix: String): ObjectMapping2[R, A1, A2]
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
- ObjectMapping2 → Mapping