@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.

Public methods

boolean
synchronized LogSessionId

Returns the LogSessionId for this player instance.

int
synchronized void
@RequiresApi(value = 31)
setLogSessionId(LogSessionId logSessionId)

Set the LogSessionId for this player instance.

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.

Parameters
String playerName

The name of the player, for informational purpose only.

Public methods

equals

public boolean equals(@Nullable Object o)

getLogSessionId

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

Returns the LogSessionId for this player instance.

hashCode

public int hashCode()

setLogSessionId

@RequiresApi(value = 31)
synchronized public void setLogSessionId(LogSessionId logSessionId)

Set the LogSessionId for this player instance.

Must not be called if already set.