CommandButton.DisplayConstraints.Builder


public final class CommandButton.DisplayConstraints.Builder


A builder for DisplayConstraints.

Summary

Public constructors

Creates the builder.

Public methods

CommandButton.DisplayConstraints

Builds the display constraints.

CommandButton.DisplayConstraints.Builder
@CanIgnoreReturnValue
setAllowCustomCommandsForSlot(
    @CommandButton.Slot int slot,
    boolean allowCustomCommands
)

Sets whether custom session commands are allowed for buttons in the given slot.

CommandButton.DisplayConstraints.Builder

Sets the allowed Player.Commands for buttons in the given slot.

CommandButton.DisplayConstraints.Builder

Sets the allowed non-custom SessionCommands for buttons in the given slot.

CommandButton.DisplayConstraints.Builder

Sets the maximum number of buttons that can be displayed in a slot.

Public constructors

Builder

public Builder()

Creates the builder.

Public methods

build

public CommandButton.DisplayConstraints build()

Builds the display constraints.

setAllowCustomCommandsForSlot

@CanIgnoreReturnValue
public CommandButton.DisplayConstraints.Builder setAllowCustomCommandsForSlot(
    @CommandButton.Slot int slot,
    boolean allowCustomCommands
)

Sets whether custom session commands are allowed for buttons in the given slot.

The default value is true.

Parameters
@CommandButton.Slot int slot

The Slot.

boolean allowCustomCommands

Whether custom session commands are allowed for buttons in this slot.

setAllowedPlayerCommandsForSlot

@CanIgnoreReturnValue
public CommandButton.DisplayConstraints.Builder setAllowedPlayerCommandsForSlot(
    @CommandButton.Slot int slot,
    @Nullable Player.Commands allowedPlayerCommands
)

Sets the allowed Player.Commands for buttons in the given slot.

The default value (null) does not restrict the allowed Player.Commands.

Parameters
@CommandButton.Slot int slot

The Slot.

@Nullable Player.Commands allowedPlayerCommands

The allowed Player.Commands for buttons in this slot, or null to allow all Player.Commands .

setAllowedSessionCommandsForSlot

@CanIgnoreReturnValue
public CommandButton.DisplayConstraints.Builder setAllowedSessionCommandsForSlot(
    @CommandButton.Slot int slot,
    @Nullable SessionCommands allowedSessionCommands
)

Sets the allowed non-custom SessionCommands for buttons in the given slot.

The default value (null) does not restrict the allowed SessionCommands.

This setting has no effect on whether custom session commands are allowed. Use setAllowCustomCommandsForSlot instead.

Parameters
@CommandButton.Slot int slot

The Slot.

@Nullable SessionCommands allowedSessionCommands

The allowed SessionCommands for buttons in this slot, or null to allow all SessionCommands.

setMaxButtonsForSlot

@CanIgnoreReturnValue
public CommandButton.DisplayConstraints.Builder setMaxButtonsForSlot(@CommandButton.Slot int slot, int maxButtons)

Sets the maximum number of buttons that can be displayed in a slot.

The default values are:

Parameters
@CommandButton.Slot int slot

The Slot.

int maxButtons

The maximum number of buttons that can be displayed in this slot.