# Player.Commands

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

*** ** * ** ***

<br />

```
class Player.Commands
```

<br />

*** ** * ** ***

A set of `https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Command`.

Instances are immutable.

## Summary

| ### Nested types |
|---|
| `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi class https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Commands.Builder` A builder for `https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Commands` instances. |

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

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Commands.Builder!` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Commands#buildUpon()()` Returns a `https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Commands.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/common/Player.Commands#contains(int)(@https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Command command: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns whether the set of commands contains the specified `https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Command`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Commands#containsAny(int...)(@https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Command commands: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>!)` Returns whether the set of commands contains at least one of the given `commands`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Commands#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/common/Player.Commands!` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Commands#fromBundle(android.os.Bundle)(bundle: https://developer.android.com/reference/android/os/Bundle.html!)` Restores a `Commands` 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/common/Player.Command https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Commands#get(int)(index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns the `https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Command` at the given index. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Commands#hashCode()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Commands#size()()` Returns the number of commands in this set. |
| `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/common/Player.Commands#toBundle()()` |

## Constants

### EMPTY

```
const val EMPTY: Player.Commands!
```

An empty set of commands.

## Public functions

### buildUpon

```
@UnstableApi
fun buildUpon(): Player.Commands.Builder!
```

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

### contains

```
fun contains(@Player.Command command: Int): Boolean
```

Returns whether the set of commands contains the specified `https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Command`.

### containsAny

```
fun containsAny(@Player.Command commands: IntArray<Int>!): Boolean
```

Returns whether the set of commands contains at least one of the given `commands`.

### equals

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

### fromBundle

```
@UnstableApi
java-static fun fromBundle(bundle: Bundle!): Player.Commands!
```

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

### get

```
@Player.Command
fun get(index: Int): Int
```

Returns the `https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Command` at the given index.

| Parameters |
|---|---|
| `index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The index. Must be between 0 (inclusive) and `https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Commands#size()` (exclusive). |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The `https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Command` at the given index. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IndexOutOfBoundsException.html` | If index is outside the allowed range. |

### hashCode

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

### size

```
fun size(): Int
```

Returns the number of commands in this set.

### toBundle

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