---
title: "ActionParameters"
description: "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."
type: "class"
---

<div class='type'>Class</div>


<a id='references'></a>

<div class='sourceset sourceset-android'>Android</div>


```kotlin
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

```kotlin
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 |



```kotlin
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 |



```kotlin
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 |



```kotlin
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 |



```kotlin
public abstract fun isEmpty(): Boolean
```


Returns whether there are any keys stored in the parameters.



