ActionParameters

Class
Android
public 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

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

Returns true if the Parameters set contains the given Key.

Parameters

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

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

Parameters

T the type of the parameter
key the key for the parameter
public 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.

Parameters

T the type of the parameter
key the key for the parameter
defaultValue the default value to return if key is missing
public 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
public abstract fun isEmpty(): Boolean

Returns whether there are any keys stored in the parameters.