SessionCommandGroup2.Builder

public static final class SessionCommandGroup2.Builder
extends Object

java.lang.Object
   ↳ androidx.media2.SessionCommandGroup2.Builder


Builds a SessionCommandGroup2 object.

Summary

Public constructors

SessionCommandGroup2.Builder()
SessionCommandGroup2.Builder(SessionCommandGroup2 commandGroup)

Creates a new builder for SessionCommandGroup2 with commands copied from another SessionCommandGroup2 object.

Public methods

SessionCommandGroup2.Builder addAllPredefinedCommands()

Adds all predefined commands to this command group.

SessionCommandGroup2.Builder addCommand(SessionCommand2 command)

Adds a command to this command group.

SessionCommandGroup2.Builder addCommand(int commandCode)

Adds a predefined command with given commandCode to this command group.

SessionCommandGroup2 build()

Builds SessionCommandGroup2.

SessionCommandGroup2.Builder removeCommand(SessionCommand2 command)

Removes a command from this group which matches given command.

SessionCommandGroup2.Builder removeCommand(int commandCode)

Removes a command from this group which matches given commandCode.

Inherited methods

Public constructors

SessionCommandGroup2.Builder

public SessionCommandGroup2.Builder ()

SessionCommandGroup2.Builder

public SessionCommandGroup2.Builder (SessionCommandGroup2 commandGroup)

Creates a new builder for SessionCommandGroup2 with commands copied from another SessionCommandGroup2 object.

Public methods

addAllPredefinedCommands

public SessionCommandGroup2.Builder addAllPredefinedCommands ()

Adds all predefined commands to this command group.

Returns
SessionCommandGroup2.Builder

addCommand

public SessionCommandGroup2.Builder addCommand (SessionCommand2 command)

Adds a command to this command group.

Parameters
command SessionCommand2: A command to add. Shouldn't be null.

Returns
SessionCommandGroup2.Builder

addCommand

public SessionCommandGroup2.Builder addCommand (int commandCode)

Adds a predefined command with given commandCode to this command group.

Parameters
commandCode int: A command code to add. Shouldn't be SessionCommand2.COMMAND_CODE_CUSTOM.

Returns
SessionCommandGroup2.Builder

removeCommand

public SessionCommandGroup2.Builder removeCommand (SessionCommand2 command)

Removes a command from this group which matches given command.

Parameters
command SessionCommand2: A command to find. Shouldn't be null.

Returns
SessionCommandGroup2.Builder

removeCommand

public SessionCommandGroup2.Builder removeCommand (int commandCode)

Removes a command from this group which matches given commandCode.

Parameters
commandCode int: A command code to find. Shouldn't be SessionCommand2.COMMAND_CODE_CUSTOM.

Returns
SessionCommandGroup2.Builder