QueryString

io.lemonlabs.uri.QueryString
See theQueryString companion object
case class QueryString(params: Vector[(String, Option[String])])(implicit config: UriConfig)

Attributes

Companion:
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Members list

Concise view

Type members

Types

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

Value members

Concrete methods

def addParam[K : QueryKey, V : QueryValue](k: K, v: 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

Attributes

Returns:

A new instance with the new parameter added

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

Attributes

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

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

Attributes

def addParams[KV : QueryKeyValue](first: KV, second: KV, kvs: 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

Attributes

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

Attributes

def collect[KV : QueryKeyValue](f: PartialFunction[(String, Option[String]), 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.

Attributes

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

Attributes

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

Attributes

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

Attributes

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

Attributes

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

Transforms each parameter by applying the specified Function

Transforms each parameter by applying the specified Function

Attributes

f

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

def isEmpty: Boolean
def map[KV : QueryKeyValue](f: PartialFunction[(String, Option[String]), 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.

Attributes

f

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

def mapNames[K : QueryKey](f: String => K): QueryString

Transforms each parameter name by applying the specified Function

Transforms each parameter name by applying the specified Function

Attributes

def mapValues[V : QueryValue](f: String => V): QueryString

Transforms each parameter value by applying the specified Function

Transforms each parameter value by applying the specified Function

Attributes

def nonEmpty: Boolean
def param(key: String): Option[String]
def params(key: String): Vector[Option[String]]

Removes all Query String parameters with the specified key

Removes all Query String parameters with the specified key

Attributes

k

Key for the Query String parameter(s) to remove

def removeAll[K : QueryKey](first: K, second: K, rest: 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

Attributes

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 : QueryKey](k: Iterable[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

Attributes

k

Names of Query String parameter(s) to remove

def replaceAll[K : QueryKey, V : QueryValue](k: K, v: 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

Attributes

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

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns:

a string representation of the object.

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)

Attributes

Returns:

String containing the raw query string for this Uri

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product

Concrete fields

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