@UnstableApi
public final class PlayerId


Identifier for a player instance.

Summary

Constants

static final PlayerId

A player identifier with unset default values that can be used as a placeholder or for testing.

Public fields

final String

A name to identify the player.

Public constructors

PlayerId(String playerName)

Creates an instance for API <31.

@RequiresApi(value = 31)
PlayerId(LogSessionId logSessionId, String playerName)

Creates an instance for API ≥ 31.

Public methods

boolean
LogSessionId

Returns the LogSessionId for this player instance.

int

Constants

UNSET

public static final PlayerId UNSET

A player identifier with unset default values that can be used as a placeholder or for testing.

Public fields

name

public final String name

A name to identify the player. Use setName to set the name, otherwise an empty string is used as the default.

Public constructors

PlayerId

public PlayerId(String playerName)

Creates an instance for API <31.

Parameters
String playerName

The name of the player, for informational purpose only.

PlayerId

@RequiresApi(value = 31)
public PlayerId(LogSessionId logSessionId, String playerName)

Creates an instance for API ≥ 31.

Parameters
LogSessionId logSessionId

The LogSessionId used for this player.

String playerName

The name of the player, for informational purpose only.

Public methods

equals

public boolean equals(@Nullable Object o)

getLogSessionId

@RequiresApi(value = 31)
public LogSessionId getLogSessionId()

Returns the LogSessionId for this player instance.

hashCode

public int hashCode()