Package com.google.android.exoplayer2

## Class Player.Commands.Builder

- java.lang.Object
- - com.google.android.exoplayer2.Player.Commands.Builder

- Enclosing class:
    Player.Commands

      public static final class Player.Commands.Builder
      extends Object

  A builder for `Player.Commands` instances.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `Builder()` | Creates a builder.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Player.Commands.Builder` | `add​(int command)` | Adds a `Player.Command`.
    `Player.Commands.Builder` | `addAll​(int... commands)` | Adds `commands`.
    `Player.Commands.Builder` | `addAll​(Player.Commands commands)` | Adds `Player.Commands`.
    `Player.Commands.Builder` | `addAllCommands()` | Adds all existing `commands`.
    `Player.Commands.Builder` | `addIf​(int command, boolean condition)` | Adds a `Player.Command` if the provided condition is true.
    `Player.Commands` | `build()` | Builds a `Player.Commands` instance.
    `Player.Commands.Builder` | `remove​(int command)` | Removes a `Player.Command`.
    `Player.Commands.Builder` | `removeAll​(int... commands)` | Removes `commands`.
    `Player.Commands.Builder` | `removeIf​(int command, boolean condition)` | Removes a `Player.Command` if the provided condition is true.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Builder

          public Builder()

      Creates a builder.

  - ### Method Detail

    - #### add

          public Player.Commands.Builder add​(@Command
                                             int command)

      Adds a `Player.Command`.
      Parameters:
        `command` - A `Player.Command`.
      Returns:
        This builder.
      Throws:
        `IllegalStateException` - If `build()` has already been called.

    - #### addIf

          public Player.Commands.Builder addIf​(@Command
                                               int command,
                                               boolean condition)

      Adds a `Player.Command` if the provided condition is true. Does nothing otherwise.
      Parameters:
        `command` - A `Player.Command`.
        `condition` - A condition.
      Returns:
        This builder.
      Throws:
        `IllegalStateException` - If `build()` has already been called.

    - #### addAll

          public Player.Commands.Builder addAll​(@Command
                                                int... commands)

      Adds `commands`.
      Parameters:
        `commands` - The `commands` to add.
      Returns:
        This builder.
      Throws:
        `IllegalStateException` - If `build()` has already been called.

    - #### addAll

          public Player.Commands.Builder addAll​(Player.Commands commands)

      Adds `Player.Commands`.
      Parameters:
        `commands` - The set of `commands` to add.
      Returns:
        This builder.
      Throws:
        `IllegalStateException` - If `build()` has already been called.

    - #### addAllCommands

          public Player.Commands.Builder addAllCommands()

      Adds all existing `commands`.
      Returns:
        This builder.
      Throws:
        `IllegalStateException` - If `build()` has already been called.

    - #### remove

          public Player.Commands.Builder remove​(@Command
                                                int command)

      Removes a `Player.Command`.
      Parameters:
        `command` - A `Player.Command`.
      Returns:
        This builder.
      Throws:
        `IllegalStateException` - If `build()` has already been called.

    - #### removeIf

          public Player.Commands.Builder removeIf​(@Command
                                                  int command,
                                                  boolean condition)

      Removes a `Player.Command` if the provided condition is true. Does nothing otherwise.
      Parameters:
        `command` - A `Player.Command`.
        `condition` - A condition.
      Returns:
        This builder.
      Throws:
        `IllegalStateException` - If `build()` has already been called.

    - #### removeAll

          public Player.Commands.Builder removeAll​(@Command
                                                   int... commands)

      Removes `commands`.
      Parameters:
        `commands` - The `commands` to remove.
      Returns:
        This builder.
      Throws:
        `IllegalStateException` - If `build()` has already been called.

    - #### build

          public Player.Commands build()

      Builds a `Player.Commands` instance.
      Throws:
        `IllegalStateException` - If this method has already been called.