Record Class PlayerProfile
java.lang.Object
java.lang.Record
fr.mathildeuh.youneedme.api.model.PlayerProfile
public record PlayerProfile(UUID uuid, String lastKnownUsername, @Nullable String nickname, @Nullable String languageCode, long firstJoinedAt, long lastSeenAt, long playtimeSeconds, @Nullable Position lastLocation, @Nullable Position lastDeathLocation)
extends Record
Cross-module, per-player data that doesn't belong to any single feature: identity, nickname,
language choice, playtime and the last few locations used by
/back and /dback.-
Constructor Summary
ConstructorsConstructorDescriptionPlayerProfile(UUID uuid, String lastKnownUsername, @Nullable String nickname, @Nullable String languageCode, long firstJoinedAt, long lastSeenAt, long playtimeSeconds, @Nullable Position lastLocation, @Nullable Position lastDeathLocation) Creates an instance of aPlayerProfilerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.longReturns the value of thefirstJoinedAtrecord component.final inthashCode()Returns a hash code value for this object.@Nullable StringReturns the value of thelanguageCoderecord component.@Nullable PositionReturns the value of thelastDeathLocationrecord component.Returns the value of thelastKnownUsernamerecord component.@Nullable PositionReturns the value of thelastLocationrecord component.longReturns the value of thelastSeenAtrecord component.@Nullable Stringnickname()Returns the value of thenicknamerecord component.longReturns the value of theplaytimeSecondsrecord component.final StringtoString()Returns a string representation of this record class.uuid()Returns the value of theuuidrecord component.withLanguageCode(@Nullable String newLanguageCode) withLastDeathLocation(@Nullable Position newLastDeathLocation) withLastLocation(@Nullable Position newLastLocation) withNickname(@Nullable String newNickname)
-
Constructor Details
-
PlayerProfile
public PlayerProfile(UUID uuid, String lastKnownUsername, @Nullable @Nullable String nickname, @Nullable @Nullable String languageCode, long firstJoinedAt, long lastSeenAt, long playtimeSeconds, @Nullable @Nullable Position lastLocation, @Nullable @Nullable Position lastDeathLocation) Creates an instance of aPlayerProfilerecord class.- Parameters:
uuid- the value for theuuidrecord componentlastKnownUsername- the value for thelastKnownUsernamerecord componentnickname- the value for thenicknamerecord componentlanguageCode- the value for thelanguageCoderecord componentfirstJoinedAt- the value for thefirstJoinedAtrecord componentlastSeenAt- the value for thelastSeenAtrecord componentplaytimeSeconds- the value for theplaytimeSecondsrecord componentlastLocation- the value for thelastLocationrecord componentlastDeathLocation- the value for thelastDeathLocationrecord component
-
-
Method Details
-
withNickname
-
withLanguageCode
-
withLastLocation
-
withLastDeathLocation
-
displayName
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
uuid
Returns the value of theuuidrecord component.- Returns:
- the value of the
uuidrecord component
-
lastKnownUsername
Returns the value of thelastKnownUsernamerecord component.- Returns:
- the value of the
lastKnownUsernamerecord component
-
nickname
Returns the value of thenicknamerecord component.- Returns:
- the value of the
nicknamerecord component
-
languageCode
Returns the value of thelanguageCoderecord component.- Returns:
- the value of the
languageCoderecord component
-
firstJoinedAt
public long firstJoinedAt()Returns the value of thefirstJoinedAtrecord component.- Returns:
- the value of the
firstJoinedAtrecord component
-
lastSeenAt
public long lastSeenAt()Returns the value of thelastSeenAtrecord component.- Returns:
- the value of the
lastSeenAtrecord component
-
playtimeSeconds
public long playtimeSeconds()Returns the value of theplaytimeSecondsrecord component.- Returns:
- the value of the
playtimeSecondsrecord component
-
lastLocation
Returns the value of thelastLocationrecord component.- Returns:
- the value of the
lastLocationrecord component
-
lastDeathLocation
Returns the value of thelastDeathLocationrecord component.- Returns:
- the value of the
lastDeathLocationrecord component
-