Formatter

play.api.data.format.Formatter
trait Formatter[T]

Handles field binding and unbinding.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

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

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

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

Value parameters

data

the submitted data

key

the field key

Attributes

Returns

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

def unbind(key: String, value: T): 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

key

the field ke

value

the value to unbind

Attributes

Returns

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

Concrete fields

val format: Option[(String, Seq[Any])]

The expected format of Any.

The expected format of Any.

Attributes