belongs to Maven artifact androidx.media2:media2:1.0.0-alpha01

SessionCommandGroup2

public final class SessionCommandGroup2
extends Object

java.lang.Object
   ↳ androidx.media2.SessionCommandGroup2


A set of SessionCommand2 which represents a command group.

Summary

Public constructors

SessionCommandGroup2()

Default Constructor.

SessionCommandGroup2(SessionCommandGroup2 other)

Creates a new SessionCommandGroup2 with commands copied from another object.

Public methods

void addAllPredefinedCommands()

Adds all predefined commands to this command group.

void addCommand(SessionCommand2 command)

Adds a command to this command group.

void addCommand(int commandCode)

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

Set<SessionCommand2> getCommands()

Gets all commands of this command group.

boolean hasCommand(int commandCode)

Checks whether this command group has a command that matches given commandCode.

boolean hasCommand(SessionCommand2 command)

Checks whether this command group has a command that matches given command.

void removeCommand(SessionCommand2 command)

Removes a command from this group which matches given command.

void removeCommand(int commandCode)

Removes a command from this group which matches given commandCode.

Inherited methods

Public constructors

SessionCommandGroup2

public SessionCommandGroup2 ()

Default Constructor.

SessionCommandGroup2

public SessionCommandGroup2 (SessionCommandGroup2 other)

Creates a new SessionCommandGroup2 with commands copied from another object.

Parameters
other SessionCommandGroup2: The SessionCommandGroup2 instance to copy.

Public methods

addAllPredefinedCommands

public void addAllPredefinedCommands ()

Adds all predefined commands to this command group.

addCommand

public void addCommand (SessionCommand2 command)

Adds a command to this command group.

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

addCommand

public void 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.

getCommands

public Set<SessionCommand2> getCommands ()

Gets all commands of this command group.

Returns
Set<SessionCommand2>

hasCommand

public boolean hasCommand (int commandCode)

Checks whether this command group has a command that matches given commandCode.

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

Returns
boolean

hasCommand

public boolean hasCommand (SessionCommand2 command)

Checks whether this command group has a command that matches given command.

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

Returns
boolean

removeCommand

public void removeCommand (SessionCommand2 command)

Removes a command from this group which matches given command.

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

removeCommand

public void 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.