Record Class GameStats

java.lang.Object
java.lang.Record
lol.trq.alts.model.GameStats
Record Components:
serverId - an identifier for the server these stats are for (a label the source stamps)
uuid - the player UUID these stats belong to
stats - the ordered display chips; may be empty
fetchedAt - the epoch-millis the source produced this snapshot

public record GameStats(String serverId, String uuid, List<GameStats.Stat> stats, long fetchedAt) extends Record
A server-agnostic snapshot of an account's public stats on one server, modelled as an ordered list of display GameStats.Stat chips. The library never interprets the chips: a host-side GameStatsSource produces them ready to render (it holds any API key and knows the server's format), and the library only models and caches the result. This keeps the core usable with any server, not just one.

Everything here is optional in spirit: stats may be empty (the player exists but has nothing notable), and a source may decline to produce stats at all.

Since:
0.3.0
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final record 
    A single display chip: a short label and its value, for example ("rank", "Veteran") or ("wins", "128").
  • Constructor Summary

    Constructors
    Constructor
    Description
    GameStats(String serverId, String uuid, List<GameStats.Stat> stats, long fetchedAt)
    Takes its own copy of stats, unmodifiable, so neither the list it was built from nor the one stats() returns can change the snapshot.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    long
    Returns the value of the fetchedAt record component.
    final int
    Returns a hash code value for this object.
    Returns the value of the serverId record component.
    Returns the value of the stats record component.
    final String
    Returns a string representation of this record class.
    Returns the value of the uuid record component.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • GameStats

      public GameStats(String serverId, String uuid, List<GameStats.Stat> stats, long fetchedAt)
      Takes its own copy of stats, unmodifiable, so neither the list it was built from nor the one stats() returns can change the snapshot. null stays null.
      Since:
      0.3.0
  • Method Details

    • 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.
    • serverId

      @SerializedName("serverId") public String serverId()
      Returns the value of the serverId record component.
      Returns:
      the value of the serverId record component
    • uuid

      @SerializedName("uuid") public String uuid()
      Returns the value of the uuid record component.
      Returns:
      the value of the uuid record component
    • stats

      @SerializedName("stats") public List<GameStats.Stat> stats()
      Returns the value of the stats record component.
      Returns:
      the value of the stats record component
    • fetchedAt

      @SerializedName("fetchedAt") public long fetchedAt()
      Returns the value of the fetchedAt record component.
      Returns:
      the value of the fetchedAt record component