Player.Commands


public final class Player.Commands


A set of commands.

Instances are immutable.

Summary

Nested types

A builder for Commands instances.

Constants

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

Constants

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()