Builder

class Builder
kotlin.Any
   ↳ androidx.media2.SessionCommandGroup2.Builder

Builds a SessionCommandGroup2 object.

Summary

Public constructors

<init>(commandGroup: SessionCommandGroup2!)

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

Public methods
SessionCommandGroup2

Builds SessionCommandGroup2.

SessionCommandGroup2.Builder

Adds a command to this command group.

SessionCommandGroup2.Builder
addCommand(commandCode: Int)

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

SessionCommandGroup2.Builder
removeCommand(@NonNull command: SessionCommand2)

Removes a command from this group which matches given command.

SessionCommandGroup2.Builder
removeCommand(commandCode: Int)

Removes a command from this group which matches given commandCode.

SessionCommandGroup2.Builder

Adds all predefined commands to this command group.

Public constructors

<init>

Builder()

<init>

Builder(commandGroup: SessionCommandGroup2!)

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

Parameters
commandGroup SessionCommandGroup2!:

Public methods

build

@NonNull fun build(): SessionCommandGroup2

Builds SessionCommandGroup2.

Return
SessionCommandGroup2: a new SessionCommandGroup2.

addCommand

@NonNull fun addCommand(command: SessionCommand2!): SessionCommandGroup2.Builder

Adds a command to this command group.

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

addCommand

@NonNull fun addCommand(commandCode: Int): SessionCommandGroup2.Builder

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.

removeCommand

@NonNull fun removeCommand(@NonNull command: SessionCommand2): SessionCommandGroup2.Builder

Removes a command from this group which matches given command.

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

removeCommand

@NonNull fun removeCommand(commandCode: Int): SessionCommandGroup2.Builder

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.

addAllPredefinedCommands

@NonNull fun addAllPredefinedCommands(): SessionCommandGroup2.Builder

Adds all predefined commands to this command group.