Player.Commands


public final class Player.Commands implements Bundleable


A set of commands.

Instances are immutable.

Summary

Nested types

A builder for Commands instances.

Constants

static final Bundleable.Creator<Player.Commands>

This field is deprecated.

Use fromBundle instead.

static final Player.Commands

An empty set of commands.

Public methods

Player.Commands.Builder

Returns a Builder initialized with the values of this instance.

boolean
contains(@Player.Command int command)

Returns whether the set of commands contains the specified Command.

boolean
containsAny(@Player.Command int[] commands)

Returns whether the set of commands contains at least one of the given commands.

boolean
static Player.Commands

Restores a Commands from a Bundle.

int
@Player.Command
get(int index)

Returns the Command at the given index.

int
int

Returns the number of commands in this set.

Bundle

Returns a Bundle representing the information stored in this object.

Constants

CREATOR

@UnstableApi
public static final Bundleable.Creator<Player.CommandsCREATOR

Object that can restore Commands from a Bundle.

EMPTY

public static final Player.Commands EMPTY

An empty set of commands.

Public methods

buildUpon

@UnstableApi
public Player.Commands.Builder buildUpon()

Returns a Builder initialized with the values of this instance.

contains

public boolean contains(@Player.Command int command)

Returns whether the set of commands contains the specified Command.

containsAny

public boolean containsAny(@Player.Command int[] commands)

Returns whether the set of commands contains at least one of the given commands.

equals

public boolean equals(@Nullable Object obj)

fromBundle

@UnstableApi
public static Player.Commands fromBundle(Bundle bundle)

Restores a Commands from a Bundle.

get

@Player.Command
public int get(int index)

Returns the Command at the given index.

Parameters
int index

The index. Must be between 0 (inclusive) and size (exclusive).

Returns
int

The Command at the given index.

Throws
java.lang.IndexOutOfBoundsException

If index is outside the allowed range.

hashCode

public int hashCode()

size

public int size()

Returns the number of commands in this set.

toBundle

@UnstableApi
public Bundle toBundle()

Returns a Bundle representing the information stored in this object.