Parameters

interface Parameters : StringValues

Represents HTTP parameters as a map from case-insensitive names to collection of String values

Inherited Properties

caseInsensitiveName

abstract val caseInsensitiveName: Boolean

Specifies if map has case-sensitive or case-insensitive names

Inherited Functions

contains

open operator fun contains(name: String): Boolean

Checks if the given name exists in the map

open fun contains(name: String, value: String): Boolean

Checks if the given name and value pair exists in the map

entries

abstract fun entries(): Set<Entry<String, List<String>>>

Gets all entries from the map

forEach

open fun forEach(body: (String, List<String>) -> Unit): Unit

Iterates over all entries in this map and calls body for each pair

get

open operator fun get(name: String): String?

Gets first value from the list of values associated with a name, or null if the name is not present

getAll

abstract fun getAll(name: String): List<String>?

Gets all values associated with the name, or null if the name is not present

isEmpty

abstract fun isEmpty(): Boolean

Checks if this map is empty

names

abstract fun names(): Set<String>

Gets all names from the map

Companion Object Properties

Empty

val Empty: Parameters

Empty Parameters instance

Companion Object Functions

build

fun build(builder: ParametersBuilder.() -> Unit): Parameters

Builds a Parameters instance with the given builder function

Extension Functions

filter

fun StringValues.filter(
    keepEmpty: Boolean = false,
    predicate: (String, String) -> Boolean
): StringValues

Create a new instance of StringValues filtered by the specified predicate

flattenEntries

fun StringValues.flattenEntries(): List<Pair<String, String>>

Copy values to a list of pairs

flattenForEach

fun StringValues.flattenForEach(
    block: (String, String) -> Unit
): Unit

Invoke block function for every value pair

formUrlEncode

fun Parameters.formUrlEncode(): String

Encode form parameters

formUrlEncodeTo

fun Parameters.formUrlEncodeTo(out: Appendable): Unit

Encode form parameters to the specified out appendable

getOrFail

fun Parameters.getOrFail(name: String): String

Get parameters value associated with this name or fail with MissingRequestParameterException

getValue

operator fun <R : Any> Parameters.getValue(
    thisRef: Any?,
    property: KProperty<*>
): R

Operator function that allows to delegate variables by call parameters. It does conversion to type R using DefaultConversionService

plus

operator fun Parameters.plus(other: Parameters): Parameters

Plus operator function that creates a new parameters instance from the original one concatenating with other

toMap

fun StringValues.toMap(): Map<String, List<String>>

Copy values to a new independent map

Inheritors

EmptyParameters

object EmptyParameters : Parameters

ParametersImpl

class ParametersImpl : Parameters, StringValuesImpl

ParametersSingleImpl

class ParametersSingleImpl : 
    Parameters,
    StringValuesSingleImpl