MutableActionParameters

Class

Android
class MutableActionParameters
internal constructor(internal val map: MutableMap<Key<out Any>, Any> = mutableMapOf()) :
    ActionParameters()

Mutable version of ActionParameters. Allows for editing the underlying data, and adding or removing key-value pairs.

Functions

operator fun <T : Any> set(key: Key<T>, value: T?): T?

Sets a key value pair in MutableParameters. If the value is null, the key is removed from the parameters.

Parameters

keythe parameter to set
valuethe value to assign to this parameter

Returns

the previous value associated with the key, or null if the key was not present
fun <T : Any> remove(key: Key<T>) = map.remove(key) as T?

Removes an item from this MutableParameters.

Parameters

keythe parameter to remove

Returns

the original value of the parameter
fun clear() = map.clear()

Removes all parameters from this MutableParameters.