Record Class RecentMatch

java.lang.Object
java.lang.Record
dev.itsharshxd.zentrix.api.profile.RecentMatch
Record Components:
matchId - identifies the match; stable across reads of the same history
endedAt - when the player's match ended, in epoch milliseconds
teamMode - whether the match was played in teams rather than solo
arena - the arena name, or null when unknown
gameType - the game type name, or null when unknown
outcome - how the match ended for the player
placement - solo or team placement, or 0 while it is unknown
kills - kills credited in the match
assists - assists credited in the match
damageDealt - damage dealt in the match
survivalSeconds - seconds survived in the match, or -1 when unknown

public record RecentMatch(@Nullable String matchId, long endedAt, boolean teamMode, @Nullable String arena, @Nullable String gameType, @NotNull RecentMatch.MatchOutcome outcome, int placement, int kills, int assists, double damageDealt, long survivalSeconds) extends Record
One finished match in a player's recent match history, as Zentrix stores it.

A profile keeps its most recent matches, newest first. A match's placement can be decided after the player's own part in it ended - a team still fighting, or a player who may rejoin - so an entry read early may show no placement yet and a settled one later.

Since:
1.8.0
  • Constructor Details

    • RecentMatch

      public RecentMatch(@Nullable @Nullable String matchId, long endedAt, boolean teamMode, @Nullable @Nullable String arena, @Nullable @Nullable String gameType, @NotNull @NotNull RecentMatch.MatchOutcome outcome, int placement, int kills, int assists, double damageDealt, long survivalSeconds)
      Creates an instance of a RecentMatch record class.
      Parameters:
      matchId - the value for the matchId record component
      endedAt - the value for the endedAt record component
      teamMode - the value for the teamMode record component
      arena - the value for the arena record component
      gameType - the value for the gameType record component
      outcome - the value for the outcome record component
      placement - the value for the placement record component
      kills - the value for the kills record component
      assists - the value for the assists record component
      damageDealt - the value for the damageDealt record component
      survivalSeconds - the value for the survivalSeconds record component
  • Method Details

    • placementIfKnown

      @NotNull public @NotNull OptionalInt placementIfKnown()
      The placement, or empty while it is not decided.
    • survivalIfKnown

      @NotNull public @NotNull OptionalLong survivalIfKnown()
      Seconds survived, or empty when not recorded.
    • arenaIfKnown

      @NotNull public @NotNull Optional<String> arenaIfKnown()
      The arena, when recorded.
    • gameTypeIfKnown

      @NotNull public @NotNull Optional<String> gameTypeIfKnown()
      The game type, when recorded.
    • 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 '=='.
      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.
    • matchId

      @Nullable public @Nullable String matchId()
      Returns the value of the matchId record component.
      Returns:
      the value of the matchId record component
    • endedAt

      public long endedAt()
      Returns the value of the endedAt record component.
      Returns:
      the value of the endedAt record component
    • teamMode

      public boolean teamMode()
      Returns the value of the teamMode record component.
      Returns:
      the value of the teamMode record component
    • arena

      @Nullable public @Nullable String arena()
      Returns the value of the arena record component.
      Returns:
      the value of the arena record component
    • gameType

      @Nullable public @Nullable String gameType()
      Returns the value of the gameType record component.
      Returns:
      the value of the gameType record component
    • outcome

      @NotNull public @NotNull RecentMatch.MatchOutcome outcome()
      Returns the value of the outcome record component.
      Returns:
      the value of the outcome record component
    • placement

      public int placement()
      Returns the value of the placement record component.
      Returns:
      the value of the placement record component
    • kills

      public int kills()
      Returns the value of the kills record component.
      Returns:
      the value of the kills record component
    • assists

      public int assists()
      Returns the value of the assists record component.
      Returns:
      the value of the assists record component
    • damageDealt

      public double damageDealt()
      Returns the value of the damageDealt record component.
      Returns:
      the value of the damageDealt record component
    • survivalSeconds

      public long survivalSeconds()
      Returns the value of the survivalSeconds record component.
      Returns:
      the value of the survivalSeconds record component