The Android Developer Challenge is back! Submit your idea before December 2.

SessionCommandGroup

public final class SessionCommandGroup
extends Object implements VersionedParcelable

java.lang.Object
   ↳ androidx.media2.session.SessionCommandGroup


A set of SessionCommand which represents a command group.

Summary

Nested classes

class SessionCommandGroup.Builder

Builds a SessionCommandGroup object. 

Public constructors

SessionCommandGroup()

Default Constructor.

SessionCommandGroup(Collection<SessionCommand> commands)

Creates a new SessionCommandGroup with commands copied from another object.

Public methods

boolean equals(Object obj)
Set<SessionCommand> 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(SessionCommand command)

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

int hashCode()

Inherited methods

Public constructors

SessionCommandGroup

public SessionCommandGroup ()

Default Constructor.

SessionCommandGroup

public SessionCommandGroup (Collection<SessionCommand> commands)

Creates a new SessionCommandGroup with commands copied from another object.

Parameters
commands Collection: The collection of commands to copy.

Public methods

equals

public boolean equals (Object obj)

Parameters
obj Object

Returns
boolean

getCommands

public Set<SessionCommand> getCommands ()

Gets all commands of this command group.

Returns
Set<SessionCommand>

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 SessionCommand.COMMAND_CODE_CUSTOM.

Returns
boolean

hasCommand

public boolean hasCommand (SessionCommand command)

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

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

Returns
boolean

hashCode

public int hashCode ()

Returns
int