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 forPlayer.Commandsinstances.
-
-
Constructor Summary
Constructors Constructor Description Builder()Creates a builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Player.Commands.Builderadd(@com.google.android.exoplayer2.Player.Command int command)Adds aPlayer.Command.Player.Commands.BuilderaddAll(@com.google.android.exoplayer2.Player.Command int... commands)Adds commands.Player.Commands.BuilderaddAll(Player.Commands commands)AddsPlayer.Commands.Player.Commands.BuilderaddAllCommands()Adds all existing commands.Player.Commands.BuilderaddIf(@com.google.android.exoplayer2.Player.Command int command, boolean condition)Adds aPlayer.Commandif the provided condition is true.Player.Commandsbuild()Builds aPlayer.Commandsinstance.Player.Commands.Builderremove(@com.google.android.exoplayer2.Player.Command int command)Removes aPlayer.Command.Player.Commands.BuilderremoveAll(@com.google.android.exoplayer2.Player.Command int... commands)Removes commands.Player.Commands.BuilderremoveIf(@com.google.android.exoplayer2.Player.Command int command, boolean condition)Removes aPlayer.Commandif the provided condition is true.
-
-
-
Method Detail
-
add
@CanIgnoreReturnValue public Player.Commands.Builder add(@Command @com.google.android.exoplayer2.Player.Command int command)
Adds aPlayer.Command.- Parameters:
command- APlayer.Command.- Returns:
- This builder.
- Throws:
IllegalStateException- Ifbuild()has already been called.
-
addIf
@CanIgnoreReturnValue public Player.Commands.Builder addIf(@Command @com.google.android.exoplayer2.Player.Command int command, boolean condition)
Adds aPlayer.Commandif the provided condition is true. Does nothing otherwise.- Parameters:
command- APlayer.Command.condition- A condition.- Returns:
- This builder.
- Throws:
IllegalStateException- Ifbuild()has already been called.
-
addAll
@CanIgnoreReturnValue public Player.Commands.Builder addAll(@Command @com.google.android.exoplayer2.Player.Command int... commands)
Adds commands.- Parameters:
commands- The commands to add.- Returns:
- This builder.
- Throws:
IllegalStateException- Ifbuild()has already been called.
-
addAll
@CanIgnoreReturnValue public Player.Commands.Builder addAll(Player.Commands commands)
AddsPlayer.Commands.- Parameters:
commands- The set of commands to add.- Returns:
- This builder.
- Throws:
IllegalStateException- Ifbuild()has already been called.
-
addAllCommands
@CanIgnoreReturnValue public Player.Commands.Builder addAllCommands()
Adds all existing commands.- Returns:
- This builder.
- Throws:
IllegalStateException- Ifbuild()has already been called.
-
remove
@CanIgnoreReturnValue public Player.Commands.Builder remove(@Command @com.google.android.exoplayer2.Player.Command int command)
Removes aPlayer.Command.- Parameters:
command- APlayer.Command.- Returns:
- This builder.
- Throws:
IllegalStateException- Ifbuild()has already been called.
-
removeIf
@CanIgnoreReturnValue public Player.Commands.Builder removeIf(@Command @com.google.android.exoplayer2.Player.Command int command, boolean condition)
Removes aPlayer.Commandif the provided condition is true. Does nothing otherwise.- Parameters:
command- APlayer.Command.condition- A condition.- Returns:
- This builder.
- Throws:
IllegalStateException- Ifbuild()has already been called.
-
removeAll
@CanIgnoreReturnValue public Player.Commands.Builder removeAll(@Command @com.google.android.exoplayer2.Player.Command int... commands)
Removes commands.- Parameters:
commands- The commands to remove.- Returns:
- This builder.
- Throws:
IllegalStateException- Ifbuild()has already been called.
-
build
public Player.Commands build()
Builds aPlayer.Commandsinstance.- Throws:
IllegalStateException- If this method has already been called.
-
-