SessionCommandGroup.Builder

Added in 1.0.0
Deprecated in 1.3.0

public final class SessionCommandGroup.Builder


Builds a SessionCommandGroup object.

Summary

Public constructors

Creates a new builder for SessionCommandGroup with commands copied from another SessionCommandGroup object.

Public methods

@NonNull SessionCommandGroup.Builder

Adds all predefined session commands except for the commands added after the specified version without default implementation.

@NonNull SessionCommandGroup.Builder

Adds a command to this command group.

@NonNull SessionCommandGroup

Builds a SessionCommandGroup.

@NonNull SessionCommandGroup.Builder

Removes a command from this group which matches given command.

Public constructors

Builder

Added in 1.0.0
Deprecated in 1.3.0
public Builder()

Builder

Added in 1.0.0
Deprecated in 1.3.0
public Builder(@NonNull SessionCommandGroup commandGroup)

Creates a new builder for SessionCommandGroup with commands copied from another SessionCommandGroup object.

Parameters
@NonNull SessionCommandGroup commandGroup

Public methods

addAllPredefinedCommands

Added in 1.0.0
Deprecated in 1.3.0
public @NonNull SessionCommandGroup.Builder addAllPredefinedCommands(int version)

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
int version

command version

addCommand

Added in 1.0.0
Deprecated in 1.3.0
public @NonNull SessionCommandGroup.Builder addCommand(@NonNull SessionCommand command)

Adds a command to this command group.

Parameters
@NonNull SessionCommand command

A command to add. Shouldn't be null.

build

Added in 1.0.0
Deprecated in 1.3.0
public @NonNull SessionCommandGroup build()

Builds a SessionCommandGroup.

removeCommand

Added in 1.0.0
Deprecated in 1.3.0
public @NonNull SessionCommandGroup.Builder removeCommand(@NonNull SessionCommand command)

Removes a command from this group which matches given command.

Parameters
@NonNull SessionCommand command

A command to find. Shouldn't be null.