ActionParameters

Class

Android
abstract class ActionParameters internal constructor()

Action parameters, used to pass information to an Action.

Construct action parameters using actionParametersOf or mutableActionParametersOf, with typed key-value pairs. The Key class enforces typing of the values inserted.

Functions

abstract operator fun <T : Any> contains(key: Key<T>): Boolean

Returns true if the Parameters set contains the given Key.

Parameters

keythe key to check for
abstract operator fun <T : Any> get(key: Key<T>): T?

Get a parameter with a key. If the key is not set, returns null.

cannot be cast to T

Parameters

Tthe type of the parameter
keythe key for the parameter
abstract fun <T : Any> getOrDefault(key: Key<T>, defaultValue: @UnsafeVariance T): T

Get a parameter with a key. If the key is not set, returns the provided default value.

cannot be cast to T

Parameters

Tthe type of the parameter
keythe key for the parameter
defaultValuethe default value to return if key is missing
abstract fun asMap(): Map<Key<out Any>, Any>

Retrieves a map of all key value pairs. The map is unmodifiable, and attempts to mutate it will throw runtime exceptions.

Returns

a map of all parameters in this Parameters
abstract fun isEmpty(): Boolean

Returns whether there are any keys stored in the parameters.