Package com.btcvelocity.api.storage
Record Class PlayerData
java.lang.Object
java.lang.Record
com.btcvelocity.api.storage.PlayerData
- Record Components:
uuid- the player's unique identifierusername- the player's usernameipAddress- the player's IP address, ornullif unavailableproxyId- the identifier of the proxy the player is connected toserverName- the name of the backend server the player is on, ornullif the player has not yet joined a serverlastSeen- the epoch millisecond timestamp of the player's last activityfirstJoin- the epoch millisecond timestamp of the player's first joinplaytimeSeconds- the total accumulated playtime in seconds
public record PlayerData(@NotNull UUID uuid, @NotNull String username, @Nullable String ipAddress, @NotNull String proxyId, @Nullable String serverName, long lastSeen, long firstJoin, long playtimeSeconds)
extends Record
Immutable record representing persisted player data stored in the
PostgreSQL backend.
This record is produced by StorageService query operations
and consumed by StorageService.upsertPlayer(PlayerData) for
persistence. All timestamps are epoch milliseconds.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.longReturns the value of thefirstJoinrecord component.final inthashCode()Returns a hash code value for this object.@Nullable StringReturns the value of theipAddressrecord component.longlastSeen()Returns the value of thelastSeenrecord component.longReturns the value of theplaytimeSecondsrecord component.@NotNull StringproxyId()Returns the value of theproxyIdrecord component.@Nullable StringReturns the value of theserverNamerecord component.final StringtoString()Returns a string representation of this record class.@NotNull Stringusername()Returns the value of theusernamerecord component.@NotNull UUIDuuid()Returns the value of theuuidrecord component.
-
Constructor Details
-
PlayerData
public PlayerData(@NotNull @NotNull UUID uuid, @NotNull @NotNull String username, @Nullable @Nullable String ipAddress, @NotNull @NotNull String proxyId, @Nullable @Nullable String serverName, long lastSeen, long firstJoin, long playtimeSeconds) Creates an instance of aPlayerDatarecord class.- Parameters:
uuid- the value for theuuidrecord componentusername- the value for theusernamerecord componentipAddress- the value for theipAddressrecord componentproxyId- the value for theproxyIdrecord componentserverName- the value for theserverNamerecord componentlastSeen- the value for thelastSeenrecord componentfirstJoin- the value for thefirstJoinrecord componentplaytimeSeconds- the value for theplaytimeSecondsrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
uuid
Returns the value of theuuidrecord component.- Returns:
- the value of the
uuidrecord component
-
username
Returns the value of theusernamerecord component.- Returns:
- the value of the
usernamerecord component
-
ipAddress
Returns the value of theipAddressrecord component.- Returns:
- the value of the
ipAddressrecord component
-
proxyId
Returns the value of theproxyIdrecord component.- Returns:
- the value of the
proxyIdrecord component
-
serverName
Returns the value of theserverNamerecord component.- Returns:
- the value of the
serverNamerecord component
-
lastSeen
public long lastSeen()Returns the value of thelastSeenrecord component.- Returns:
- the value of the
lastSeenrecord component
-
firstJoin
public long firstJoin()Returns the value of thefirstJoinrecord component.- Returns:
- the value of the
firstJoinrecord component
-
playtimeSeconds
public long playtimeSeconds()Returns the value of theplaytimeSecondsrecord component.- Returns:
- the value of the
playtimeSecondsrecord component
-