Builder
class Builder
kotlin.Any | |
↳ | androidx.media2.session.SessionCommandGroup.Builder |
Builds a SessionCommandGroup
object.
Summary
Public constructors | |
---|---|
<init>() |
|
<init>(@NonNull commandGroup: SessionCommandGroup) Creates a new builder for |
Public methods | |
---|---|
SessionCommandGroup.Builder |
addAllPredefinedCommands(version: Int) Adds all predefined session commands except for the commands added after the specified version without default implementation. |
SessionCommandGroup.Builder |
addCommand(@NonNull command: SessionCommand) Adds a command to this command group. |
SessionCommandGroup |
build() Builds a |
SessionCommandGroup.Builder |
removeCommand(@NonNull command: SessionCommand) Removes a command from this group which matches given |
Public constructors
<init>
Builder()
<init>
Builder(@NonNull commandGroup: SessionCommandGroup)
Creates a new builder for SessionCommandGroup
with commands copied from another SessionCommandGroup
object.
Parameters | |
---|---|
commandGroup |
SessionCommandGroup: |
Public methods
addAllPredefinedCommands
@NonNull fun addAllPredefinedCommands(version: Int): SessionCommandGroup.Builder
Adds all predefined session commands except for the commands added after the specified version without default implementation. This provides convenient way to add commands with implementation.
When you update support library version, it's recommended to take a look SessionCommand
to double check whether this only adds commands that you want. You may increase the version here.
Parameters | |
---|---|
version |
Int: command version |
addCommand
@NonNull fun addCommand(@NonNull command: SessionCommand): SessionCommandGroup.Builder
Adds a command to this command group.
Parameters | |
---|---|
command |
SessionCommand: A command to add. Shouldn't be null . |
build
@NonNull fun build(): SessionCommandGroup
Builds a SessionCommandGroup
.
Return | |
---|---|
SessionCommandGroup |
a new SessionCommandGroup |
removeCommand
@NonNull fun removeCommand(@NonNull command: SessionCommand): SessionCommandGroup.Builder
Removes a command from this group which matches given command
.
Parameters | |
---|---|
command |
SessionCommand: A command to find. Shouldn't be null . |