SessionCommands.Builder


public final class SessionCommands.Builder


A builder for SessionCommands.

Summary

Public constructors

Creates a new builder.

Public methods

SessionCommands.Builder

Adds a command with command code.

SessionCommands.Builder

Adds a command.

SessionCommands.Builder

Adds all of the commands in the specified collection.

SessionCommands

Builds a SessionCommands.

SessionCommands.Builder

Removes a command which matches a given command code.

SessionCommands.Builder

Removes a command which matches a given command.

Public constructors

Builder

public Builder()

Creates a new builder.

Public methods

add

@CanIgnoreReturnValue
public SessionCommands.Builder add(@SessionCommand.CommandCode int commandCode)

Adds a command with command code. Command code must not be COMMAND_CODE_CUSTOM.

Parameters
@SessionCommand.CommandCode int commandCode

A command code to build command and add.

Returns
SessionCommands.Builder

This builder for chaining.

add

@CanIgnoreReturnValue
public SessionCommands.Builder add(SessionCommand command)

Adds a command.

Parameters
SessionCommand command

A command to add.

Returns
SessionCommands.Builder

This builder for chaining.

addSessionCommands

@CanIgnoreReturnValue
public SessionCommands.Builder addSessionCommands(Collection<SessionCommand> commands)

Adds all of the commands in the specified collection.

Parameters
Collection<SessionCommand> commands

collection containing elements to be added to this set

Returns
SessionCommands.Builder

This builder for chaining.

build

public SessionCommands build()

Builds a SessionCommands.

remove

@CanIgnoreReturnValue
public SessionCommands.Builder remove(@SessionCommand.CommandCode int commandCode)

Removes a command which matches a given command code. Command code must not be COMMAND_CODE_CUSTOM.

Parameters
@SessionCommand.CommandCode int commandCode

A command code to find.

Returns
SessionCommands.Builder

This builder for chaining.

remove

@CanIgnoreReturnValue
public SessionCommands.Builder remove(SessionCommand command)

Removes a command which matches a given command.

Parameters
SessionCommand command

A command to find.

Returns
SessionCommands.Builder

This builder for chaining.