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 historyendedAt- when the player's match ended, in epoch millisecondsteamMode- whether the match was played in teams rather than soloarena- the arena name, ornullwhen unknowngameType- the game type name, ornullwhen unknownoutcome- how the match ended for the playerplacement- solo or team placement, or0while it is unknownkills- kills credited in the matchassists- assists credited in the matchdamageDealt- damage dealt in the matchsurvivalSeconds- seconds survived in the match, or-1when 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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumHow a match ended for one player. -
Constructor Summary
ConstructorsConstructorDescriptionRecentMatch(@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) Creates an instance of aRecentMatchrecord class. -
Method Summary
Modifier and TypeMethodDescription@Nullable Stringarena()Returns the value of thearenarecord component.The arena, when recorded.intassists()Returns the value of theassistsrecord component.doubleReturns the value of thedamageDealtrecord component.longendedAt()Returns the value of theendedAtrecord component.final booleanIndicates whether some other object is "equal to" this one.@Nullable StringgameType()Returns the value of thegameTyperecord component.The game type, when recorded.final inthashCode()Returns a hash code value for this object.intkills()Returns the value of thekillsrecord component.@Nullable StringmatchId()Returns the value of thematchIdrecord component.@NotNull RecentMatch.MatchOutcomeoutcome()Returns the value of theoutcomerecord component.intReturns the value of theplacementrecord component.@NotNull OptionalIntThe placement, or empty while it is not decided.@NotNull OptionalLongSeconds survived, or empty when not recorded.longReturns the value of thesurvivalSecondsrecord component.booleanteamMode()Returns the value of theteamModerecord component.final StringtoString()Returns a string representation of this record class.
-
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 aRecentMatchrecord class.- Parameters:
matchId- the value for thematchIdrecord componentendedAt- the value for theendedAtrecord componentteamMode- the value for theteamModerecord componentarena- the value for thearenarecord componentgameType- the value for thegameTyperecord componentoutcome- the value for theoutcomerecord componentplacement- the value for theplacementrecord componentkills- the value for thekillsrecord componentassists- the value for theassistsrecord componentdamageDealt- the value for thedamageDealtrecord componentsurvivalSeconds- the value for thesurvivalSecondsrecord component
-
-
Method Details
-
placementIfKnown
The placement, or empty while it is not decided. -
survivalIfKnown
Seconds survived, or empty when not recorded. -
arenaIfKnown
The arena, when recorded. -
gameTypeIfKnown
The game type, when recorded. -
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 '=='. -
matchId
Returns the value of thematchIdrecord component.- Returns:
- the value of the
matchIdrecord component
-
endedAt
public long endedAt()Returns the value of theendedAtrecord component.- Returns:
- the value of the
endedAtrecord component
-
teamMode
public boolean teamMode()Returns the value of theteamModerecord component.- Returns:
- the value of the
teamModerecord component
-
arena
Returns the value of thearenarecord component.- Returns:
- the value of the
arenarecord component
-
gameType
Returns the value of thegameTyperecord component.- Returns:
- the value of the
gameTyperecord component
-
outcome
Returns the value of theoutcomerecord component.- Returns:
- the value of the
outcomerecord component
-
placement
public int placement()Returns the value of theplacementrecord component.- Returns:
- the value of the
placementrecord component
-
kills
public int kills()Returns the value of thekillsrecord component.- Returns:
- the value of the
killsrecord component
-
assists
public int assists()Returns the value of theassistsrecord component.- Returns:
- the value of the
assistsrecord component
-
damageDealt
public double damageDealt()Returns the value of thedamageDealtrecord component.- Returns:
- the value of the
damageDealtrecord component
-
survivalSeconds
public long survivalSeconds()Returns the value of thesurvivalSecondsrecord component.- Returns:
- the value of the
survivalSecondsrecord component
-