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 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 a PlayerProfile record class.
      Parameters:
      uuid - the value for the uuid record component
      lastKnownUsername - the value for the lastKnownUsername record component
      nickname - the value for the nickname record component
      languageCode - the value for the languageCode record component
      firstJoinedAt - the value for the firstJoinedAt record component
      lastSeenAt - the value for the lastSeenAt record component
      playtimeSeconds - the value for the playtimeSeconds record component
      lastLocation - the value for the lastLocation record component
      lastDeathLocation - the value for the lastDeathLocation record component
  • Method Details

    • withNickname

      public PlayerProfile withNickname(@Nullable @Nullable String newNickname)
    • withLanguageCode

      public PlayerProfile withLanguageCode(@Nullable @Nullable String newLanguageCode)
    • withLastLocation

      public PlayerProfile withLastLocation(@Nullable @Nullable Position newLastLocation)
    • withLastDeathLocation

      public PlayerProfile withLastDeathLocation(@Nullable @Nullable Position newLastDeathLocation)
    • displayName

      public String displayName()
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • uuid

      public UUID uuid()
      Returns the value of the uuid record component.
      Returns:
      the value of the uuid record component
    • lastKnownUsername

      public String lastKnownUsername()
      Returns the value of the lastKnownUsername record component.
      Returns:
      the value of the lastKnownUsername record component
    • nickname

      @Nullable public @Nullable String nickname()
      Returns the value of the nickname record component.
      Returns:
      the value of the nickname record component
    • languageCode

      @Nullable public @Nullable String languageCode()
      Returns the value of the languageCode record component.
      Returns:
      the value of the languageCode record component
    • firstJoinedAt

      public long firstJoinedAt()
      Returns the value of the firstJoinedAt record component.
      Returns:
      the value of the firstJoinedAt record component
    • lastSeenAt

      public long lastSeenAt()
      Returns the value of the lastSeenAt record component.
      Returns:
      the value of the lastSeenAt record component
    • playtimeSeconds

      public long playtimeSeconds()
      Returns the value of the playtimeSeconds record component.
      Returns:
      the value of the playtimeSeconds record component
    • lastLocation

      @Nullable public @Nullable Position lastLocation()
      Returns the value of the lastLocation record component.
      Returns:
      the value of the lastLocation record component
    • lastDeathLocation

      @Nullable public @Nullable Position lastDeathLocation()
      Returns the value of the lastDeathLocation record component.
      Returns:
      the value of the lastDeathLocation record component