Player.Commands.Builder


@UnstableApi
public final class Player.Commands.Builder


A builder for Commands instances.

Summary

Public constructors

Creates a builder.

Public constructors

Builder

public Builder()

Creates a builder.

Public methods

add

@CanIgnoreReturnValue
public Player.Commands.Builder add(@Player.Command int command)

Adds a Command.

Parameters
@Player.Command int command

A Command.

Returns
Player.Commands.Builder

This builder.

Throws
java.lang.IllegalStateException

If build has already been called.

addAll

@CanIgnoreReturnValue
public Player.Commands.Builder addAll(@Player.Command int[] commands)

Adds commands.

Parameters
@Player.Command int[] commands

The commands to add.

Returns
Player.Commands.Builder

This builder.

Throws
java.lang.IllegalStateException

If build has already been called.

addAll

@CanIgnoreReturnValue
public Player.Commands.Builder addAll(Player.Commands commands)

Adds Commands.

Parameters
Player.Commands commands

The set of commands to add.

Returns
Player.Commands.Builder

This builder.

Throws
java.lang.IllegalStateException

If build has already been called.

addAllCommands

@CanIgnoreReturnValue
public Player.Commands.Builder addAllCommands()

Adds all existing commands.

Returns
Player.Commands.Builder

This builder.

Throws
java.lang.IllegalStateException

If build has already been called.

addIf

@CanIgnoreReturnValue
public Player.Commands.Builder addIf(@Player.Command int command, boolean condition)

Adds a Command if the provided condition is true. Does nothing otherwise.

Parameters
@Player.Command int command

A Command.

boolean condition

A condition.

Returns
Player.Commands.Builder

This builder.

Throws
java.lang.IllegalStateException

If build has already been called.

build

public Player.Commands build()

Builds a Commands instance.

Throws
java.lang.IllegalStateException

If this method has already been called.

remove

@CanIgnoreReturnValue
public Player.Commands.Builder remove(@Player.Command int command)

Removes a Command.

Parameters
@Player.Command int command

A Command.

Returns
Player.Commands.Builder

This builder.

Throws
java.lang.IllegalStateException

If build has already been called.

removeAll

@CanIgnoreReturnValue
public Player.Commands.Builder removeAll(@Player.Command int[] commands)

Removes commands.

Parameters
@Player.Command int[] commands

The commands to remove.

Returns
Player.Commands.Builder

This builder.

Throws
java.lang.IllegalStateException

If build has already been called.

removeIf

@CanIgnoreReturnValue
public Player.Commands.Builder removeIf(@Player.Command int command, boolean condition)

Removes a Command if the provided condition is true. Does nothing otherwise.

Parameters
@Player.Command int command

A Command.

boolean condition

A condition.

Returns
Player.Commands.Builder

This builder.

Throws
java.lang.IllegalStateException

If build has already been called.