# SessionCommands

Artifact: [androidx.media3:media3-session](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/session/SessionCommands.java+class:androidx.media3.session.SessionCommands)

*** ** * ** ***

<br />

```
class SessionCommands
```

<br />

*** ** * ** ***

A set of `https://developer.android.com/reference/kotlin/androidx/media3/session/SessionCommand`.

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/media3/session/SessionCommands.Builder` A builder for `https://developer.android.com/reference/kotlin/androidx/media3/session/SessionCommands`. |

| ### Constants |
|---|---|
| `const https://developer.android.com/reference/kotlin/androidx/media3/session/SessionCommands!` | `https://developer.android.com/reference/kotlin/androidx/media3/session/SessionCommands#EMPTY()` An empty set of session commands. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/session/SessionCommands.Builder!` | `https://developer.android.com/reference/kotlin/androidx/media3/session/SessionCommands#buildUpon()()` Returns a `https://developer.android.com/reference/kotlin/androidx/media3/session/SessionCommands.Builder` initialized with the values of this instance. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/session/SessionCommands#contains(int)(@https://developer.android.com/reference/kotlin/androidx/media3/session/SessionCommand.CommandCode commandCode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns whether a command that matches given `commandCode` exists. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/session/SessionCommands#contains(androidx.media3.session.SessionCommand)(command: https://developer.android.com/reference/kotlin/androidx/media3/session/SessionCommand!)` Returns whether a command that matches given `command` exists. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/session/SessionCommands#equals(java.lang.Object)(obj: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `java-static https://developer.android.com/reference/kotlin/androidx/media3/session/SessionCommands!` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/session/SessionCommands#fromBundle(android.os.Bundle)(bundle: https://developer.android.com/reference/android/os/Bundle.html!)` Restores a `SessionCommands` from a `https://developer.android.com/reference/android/os/Bundle.html`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/session/SessionCommands#hashCode()()` |
| `https://developer.android.com/reference/android/os/Bundle.html!` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/session/SessionCommands#toBundle()()` |

| ### Public properties |
|---|---|
| `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableSet.html<https://developer.android.com/reference/kotlin/androidx/media3/session/SessionCommand!>!` | `https://developer.android.com/reference/kotlin/androidx/media3/session/SessionCommands#commands()` All session commands. |

## Constants

### EMPTY

```
const val EMPTY: SessionCommands!
```

An empty set of session commands.

## Public functions

### buildUpon

```
fun buildUpon(): SessionCommands.Builder!
```

Returns a `https://developer.android.com/reference/kotlin/androidx/media3/session/SessionCommands.Builder` initialized with the values of this instance.

### contains

```
fun contains(@SessionCommand.CommandCode commandCode: Int): Boolean
```

Returns whether a command that matches given `commandCode` exists.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/kotlin/androidx/media3/session/SessionCommand.CommandCode commandCode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | A `https://developer.android.com/reference/kotlin/androidx/media3/session/SessionCommand.CommandCode` command code to find. Shouldn't be `https://developer.android.com/reference/kotlin/androidx/media3/session/SessionCommand#COMMAND_CODE_CUSTOM()`. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the command exists. |

### contains

```
fun contains(command: SessionCommand!): Boolean
```

Returns whether a command that matches given `command` exists.

| Parameters |
|---|---|
| `command: https://developer.android.com/reference/kotlin/androidx/media3/session/SessionCommand!` | A command to find. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the command exists. |

### equals

```
fun equals(obj: Any?): Boolean
```

### fromBundle

```
@UnstableApi
java-static fun fromBundle(bundle: Bundle!): SessionCommands!
```

Restores a `SessionCommands` from a `https://developer.android.com/reference/android/os/Bundle.html`.

### hashCode

```
fun hashCode(): Int
```

### toBundle

```
@UnstableApi
fun toBundle(): Bundle!
```

## Public properties

### commands

```
val commands: ImmutableSet<SessionCommand!>!
```

All session commands.