QueryString

case class QueryString(params: Vector[(String, Option[String])])(implicit config: UriConfig)
Companion
object
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Type members

Types

type ParamToString = PartialFunction[(String, Option[String]), String]

Value members

Concrete methods

def addParam[K, V](k: K, v: V)(implicit evidence$1: QueryKey[K], evidence$2: QueryValue[V]): QueryString

Pairs with values, such as ("param", Some("value")), represent query params with values, i.e ?param=value

Pairs with values, such as ("param", Some("value")), represent query params with values, i.e ?param=value

By default, pairs without values, such as ("param", None), represent query params without values, i.e ?param Using a UriConfig(renderQuery = ExcludeNones), will cause pairs with None values not to be rendered

Returns

A new instance with the new parameter added

def addParam[KV](kv: KV)(implicit evidence$3: QueryKeyValue[KV]): QueryString

Adds a new Query String parameter key-value pair.

Adds a new Query String parameter key-value pair.

Pairs with values, such as ("param", Some("value")), represent query params with values, i.e ?param=value Using a UriConfig(renderQuery = ExcludeNones), will cause pairs with None values not to be rendered

By default, pairs without values, such as ("param", None), represent query params without values, i.e ?param

Adds all the specified key-value pairs as parameters to the query

Adds all the specified key-value pairs as parameters to the query

def addParams[KV](first: KV, second: KV, kvs: KV*)(implicit evidence$4: QueryKeyValue[KV]): QueryString

Adds all the specified key-value pairs as parameters to the query

Adds all the specified key-value pairs as parameters to the query

Pairs with values, such as ("param", Some("value")), represent query params with values, i.e ?param=value

By default, pairs without values, such as ("param", None), represent query params without values, i.e ?param Using a UriConfig(renderQuery = ExcludeNones), will cause pairs with None values not to be rendered

def addParams[P](kvs: P)(implicit evidence$5: TraversableParams[P]): QueryString

Adds all the specified key-value pairs as parameters to the query

Adds all the specified key-value pairs as parameters to the query

Pairs with values, such as ("param", Some("value")), represent query params with values, i.e ?param=value

By default, pairs without values, such as ("param", None), represent query params without values, i.e ?param Using a UriConfig(renderQuery = ExcludeNones), will cause pairs with None values not to be rendered

def collect[KV](f: PartialFunction[(String, Option[String]), KV])(implicit evidence$7: QueryKeyValue[KV]): QueryString

Transforms the Query String by applying the specified PartialFunction to each Query String Parameter

Transforms the Query String by applying the specified PartialFunction to each Query String Parameter

Parameters not defined in the PartialFunction will be removed.

Value Params
f

A function that returns a new Parameter when applied to each Parameter

def equalsUnordered(other: QueryString): Boolean
def filter(f: (String, Option[String]) => Boolean): QueryString

Filters out just the parameters for which the provided function holds true

Filters out just the parameters for which the provided function holds true

def filterNames(f: String => Boolean): QueryString

Filters out just the parameters for which the provided function holds true when applied to the parameter name

Filters out just the parameters for which the provided function holds true when applied to the parameter name

def filterOptionValues(f: Option[String] => Boolean): QueryString

Filters out just the parameters for which the provided function holds true when applied to the parameter value

Filters out just the parameters for which the provided function holds true when applied to the parameter value

def filterValues(f: String => Boolean): QueryString

Filters out just the parameters for which the provided function holds true when applied to the parameter value

Filters out just the parameters for which the provided function holds true when applied to the parameter value

def flatMap[A](f: (String, Option[String]) => A)(implicit evidence$8: TraversableParams[A]): QueryString

Transforms each parameter by applying the specified Function

Transforms each parameter by applying the specified Function

Value Params
f

A function that returns a collection of Parameters when applied to each parameter

def isEmpty: Boolean
def map[KV](f: PartialFunction[(String, Option[String]), KV])(implicit evidence$6: QueryKeyValue[KV]): QueryString

Transforms the Query String by applying the specified PartialFunction to each Query String Parameter

Transforms the Query String by applying the specified PartialFunction to each Query String Parameter

Parameters not defined in the PartialFunction will be left as-is.

Value Params
f

A function that returns a new Parameter when applied to each Parameter

def mapNames[K](f: String => K)(implicit evidence$9: QueryKey[K]): QueryString

Transforms each parameter name by applying the specified Function

Transforms each parameter name by applying the specified Function

def mapValues[V](f: String => V)(implicit evidence$10: QueryValue[V]): QueryString

Transforms each parameter value by applying the specified Function

Transforms each parameter value by applying the specified Function

def nonEmpty: Boolean
def param(key: String): Option[String]
def params(key: String): Vector[Option[String]]
def removeAll[K](k: K)(implicit evidence$13: QueryKey[K]): QueryString

Removes all Query String parameters with the specified key

Removes all Query String parameters with the specified key

Value Params
k

Key for the Query String parameter(s) to remove

def removeAll[K](first: K, second: K, rest: K*)(implicit evidence$14: QueryKey[K]): QueryString

Removes all Query String parameters with a name in the specified list

Removes all Query String parameters with a name in the specified list

Value Params
first

Name of a Query String parameter to remove

rest

Names of more Query String parameter(s) to remove

second

Name of another Query String parameter to remove

def removeAll[K](k: Iterable[K])(implicit evidence$15: QueryKey[K]): QueryString

Removes all Query String parameters with a name in the specified list

Removes all Query String parameters with a name in the specified list

Value Params
k

Names of Query String parameter(s) to remove

def replaceAll[K, V](k: K, v: V)(implicit evidence$11: QueryKey[K], evidence$12: QueryValue[V]): QueryString

Replaces the all existing Query String parameters with the specified key with a single Query String parameter with the specified value.

Replaces the all existing Query String parameters with the specified key with a single Query String parameter with the specified value.

If the value passed in is None, then all Query String parameters with the specified key are replaces with a valueless query param. E.g. replaceParams("q", None) would turn ?q=1&q=2 into ?q

Value Params
k

Key for the Query String parameter(s) to replace

v

value to replace with

Returns

A new QueryString with the result of the replace

override def toString: String
Definition Classes
Any
def toStringRaw: String

Returns the query string with no encoding taking place (e.g. non ASCII characters will not be percent encoded)

Returns the query string with no encoding taking place (e.g. non ASCII characters will not be percent encoded)

Returns

String containing the raw query string for this Uri

Inherited methods

def productElementNames: Iterator[String]
Inherited from
Product
def productIterator: Iterator[Any]
Inherited from
Product

Concrete fields

lazy val paramMap: Map[String, Vector[String]]