SessionCommandGroup2

public final class SessionCommandGroup2
extends Object implements VersionedParcelable

java.lang.Object
   ↳ androidx.media2.SessionCommandGroup2


A set of SessionCommand2 which represents a command group.

Summary

Nested classes

class SessionCommandGroup2.Builder

Builds a SessionCommandGroup2 object. 

Public constructors

SessionCommandGroup2()

Default Constructor.

SessionCommandGroup2(Collection<SessionCommand2> commands)

Creates a new SessionCommandGroup2 with commands copied from another object.

Public methods

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.

Inherited methods

Public constructors

SessionCommandGroup2

public SessionCommandGroup2 ()

Default Constructor.

SessionCommandGroup2

public SessionCommandGroup2 (Collection<SessionCommand2> commands)

Creates a new SessionCommandGroup2 with commands copied from another object.

Parameters
commands Collection: The collection of commands to copy.

Public methods

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