Back to Exoplayer

Player.Commands.Builder (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/Player.Commands.Builder.html

latest8.1 KB
Original Source

Package com.google.android.exoplayer2

Class Player.Commands.Builder


public static final classPlayer.Commands.Builderextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")

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​(@com.google.android.exoplayer2.Player.Command int command) | Adds a Player.Command. | | Player.Commands.Builder | addAll​(@com.google.android.exoplayer2.Player.Command 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​(@com.google.android.exoplayer2.Player.Command 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​(@com.google.android.exoplayer2.Player.Command int command) | Removes a Player.Command. | | Player.Commands.Builder | removeAll​(@com.google.android.exoplayer2.Player.Command int... commands) | Removes commands. | | Player.Commands.Builder | removeIf​(@com.google.android.exoplayer2.Player.Command 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

@CanIgnoreReturnValue
public[Player.Commands.Builder](Player.Commands.Builder.html "class in com.google.android.exoplayer2")add​([@Command](Player.Command.html "annotation in com.google.android.exoplayer2")@com.google.android.exoplayer2.Player.Command int command)

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

- 

addIf

@CanIgnoreReturnValue
public[Player.Commands.Builder](Player.Commands.Builder.html "class in com.google.android.exoplayer2")addIf​([@Command](Player.Command.html "annotation in com.google.android.exoplayer2")@com.google.android.exoplayer2.Player.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

@CanIgnoreReturnValue
public[Player.Commands.Builder](Player.Commands.Builder.html "class in com.google.android.exoplayer2")addAll​([@Command](Player.Command.html "annotation in com.google.android.exoplayer2")@com.google.android.exoplayer2.Player.Command int... commands)

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

- 

addAll

@CanIgnoreReturnValue
public[Player.Commands.Builder](Player.Commands.Builder.html "class in com.google.android.exoplayer2")addAll​([Player.Commands](Player.Commands.html "class in com.google.android.exoplayer2")commands)

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

- 

addAllCommands

@CanIgnoreReturnValue
public[Player.Commands.Builder](Player.Commands.Builder.html "class in com.google.android.exoplayer2")addAllCommands()

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

- 

remove

@CanIgnoreReturnValue
public[Player.Commands.Builder](Player.Commands.Builder.html "class in com.google.android.exoplayer2")remove​([@Command](Player.Command.html "annotation in com.google.android.exoplayer2")@com.google.android.exoplayer2.Player.Command int command)

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

- 

removeIf

@CanIgnoreReturnValue
public[Player.Commands.Builder](Player.Commands.Builder.html "class in com.google.android.exoplayer2")removeIf​([@Command](Player.Command.html "annotation in com.google.android.exoplayer2")@com.google.android.exoplayer2.Player.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

@CanIgnoreReturnValue
public[Player.Commands.Builder](Player.Commands.Builder.html "class in com.google.android.exoplayer2")removeAll​([@Command](Player.Command.html "annotation in com.google.android.exoplayer2")@com.google.android.exoplayer2.Player.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](Player.Commands.html "class in com.google.android.exoplayer2")build()

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