Package dev.deepcore.challenge.training
Record Class TrainingStatsStore.PlayerChallengeStats
java.lang.Object
java.lang.Record
dev.deepcore.challenge.training.TrainingStatsStore.PlayerChallengeStats
- Record Components:
bestTimeMs- best completed attempt in milliseconds; -1 when unknownlastAttemptsMs- 2nd through 6th best times sorted ascending (Try 1–5)
- Enclosing class:
TrainingStatsStore
public static record TrainingStatsStore.PlayerChallengeStats(long bestTimeMs, List<Long> lastAttemptsMs)
extends Record
Immutable per-player stats for one challenge.
-
Constructor Summary
ConstructorsConstructorDescriptionPlayerChallengeStats(long bestTimeMs, List<Long> lastAttemptsMs) Creates an instance of aPlayerChallengeStatsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of thebestTimeMsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thelastAttemptsMsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PlayerChallengeStats
Creates an instance of aPlayerChallengeStatsrecord class.- Parameters:
bestTimeMs- the value for thebestTimeMsrecord componentlastAttemptsMs- the value for thelastAttemptsMsrecord component
-
-
Method Details
-
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 '=='. -
bestTimeMs
public long bestTimeMs()Returns the value of thebestTimeMsrecord component.- Returns:
- the value of the
bestTimeMsrecord component
-
lastAttemptsMs
Returns the value of thelastAttemptsMsrecord component.- Returns:
- the value of the
lastAttemptsMsrecord component
-