class Parsing[A] extends QueryStringBindable[A]

A helper class for creating QueryStringBindables to map the value of a single key

A

the type being parsed

Source
Binders.scala
Linear Supertypes
QueryStringBindable[A], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Parsing
  2. QueryStringBindable
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new Parsing(parse: (String) => A, serialize: (A) => String, error: (String, Exception) => String)

    parse

    a function to parse the param value

    serialize

    a function to serialize and URL-encode the param value. Remember to encode arbitrary strings, for example using URLEncoder.encode.

    error

    a function for rendering an error message if an error occurs

Value Members

  1. def bind(key: String, params: Map[String, Seq[String]]): Option[Either[String, A]]

    Bind a query string parameter.

    Bind a query string parameter.

    key

    Parameter key

    params

    QueryString data

    returns

    None if the parameter was not present in the query string data. Otherwise, returns Some of either Right of the parameter value, or Left of an error message if the binding failed.

    Definition Classes
    QueryStringBindable
  2. def javascriptUnbind: String

    Javascript function to unbind in the Javascript router.

    Javascript function to unbind in the Javascript router.

    Definition Classes
    QueryStringBindable
  3. def transform[B](toB: (A) => B, toA: (B) => A): QueryStringBindable[B]

    Transform this QueryStringBindable[A] to QueryStringBindable[B]

    Transform this QueryStringBindable[A] to QueryStringBindable[B]

    Definition Classes
    QueryStringBindable
  4. def unbind(key: String, value: A): String

    Unbind a query string parameter.

    Unbind a query string parameter.

    key

    Parameter key

    value

    Parameter value.

    returns

    a query string fragment containing the key and its value. E.g. "foo=42"

    Definition Classes
    QueryStringBindable