Record Class Leaderboard<T extends Comparable<T>>
java.lang.Object
java.lang.Record
dev.despical.tntrun.leaderboard.Leaderboard<T>
public record Leaderboard<T extends Comparable<T>>(String id, List<LeaderboardEntry<T extends Comparable<T>>> sortedEntries, T extends Comparable<T> fallbackValue)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionLeaderboard(String id, List<LeaderboardEntry<T>> sortedEntries, T fallbackValue) Creates an instance of aLeaderboardrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of thefallbackValuerecord component.@NotNull LeaderboardEntry<T> getEntryAtPosition(int pos) final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.Returns the value of thesortedEntriesrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Leaderboard
Creates an instance of aLeaderboardrecord class.- Parameters:
id- the value for theidrecord componentsortedEntries- the value for thesortedEntriesrecord componentfallbackValue- the value for thefallbackValuerecord component
-
-
Method Details
-
getEntryAtPosition
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
sortedEntries
Returns the value of thesortedEntriesrecord component.- Returns:
- the value of the
sortedEntriesrecord component
-
fallbackValue
Returns the value of thefallbackValuerecord component.- Returns:
- the value of the
fallbackValuerecord component
-