public final class

SessionCommands.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.media3.session.SessionCommands.Builder

Overview

A builder for SessionCommands.

Summary

Constructors
publicBuilder()

Creates a new builder.

Methods
public SessionCommands.Builderadd(int commandCode)

Adds a command with command code.

public SessionCommands.Builderadd(SessionCommand command)

Adds a command.

public SessionCommands.BuilderaddSessionCommands(java.util.Collection<SessionCommand> commands)

Adds all of the commands in the specified collection.

public SessionCommandsbuild()

Builds a SessionCommands.

public SessionCommands.Builderremove(int commandCode)

Removes a command which matches a given command code.

public SessionCommands.Builderremove(SessionCommand command)

Removes a command which matches a given command.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder()

Creates a new builder.

Methods

Adds a command.

Parameters:

command: A command to add.

Returns:

This builder for chaining.

public SessionCommands.Builder add(int commandCode)

Adds a command with command code. Command code must not be SessionCommand.COMMAND_CODE_CUSTOM.

Parameters:

commandCode: A command code to build command and add.

Returns:

This builder for chaining.

public SessionCommands.Builder addSessionCommands(java.util.Collection<SessionCommand> commands)

Adds all of the commands in the specified collection.

Parameters:

commands: collection containing elements to be added to this set

Returns:

This builder for chaining.

Removes a command which matches a given command.

Parameters:

command: A command to find.

Returns:

This builder for chaining.

public SessionCommands.Builder remove(int commandCode)

Removes a command which matches a given command code. Command code must not be SessionCommand.COMMAND_CODE_CUSTOM.

Parameters:

commandCode: A command code to find.

Returns:

This builder for chaining.

public SessionCommands build()

Builds a SessionCommands.