Record Class ClaimResult
java.lang.Object
java.lang.Record
lol.trq.alts.account.ClaimResult
- Record Components:
claimed- whether the name was takenattempts- how many change attempts were madefinalResult- the change result that decided the run — the winning one on success, the one that stopped it on a terminal failure — else the last attempt's;nullwhen no attempt was madestopReason- why the run ended; added in 0.12.0failure- what ended the run, present exactly when the stop reason isClaimResult.StopReason.TERMINAL_FAILURE; a rate limit's stated wait travels in it; added in 1.0.0
public record ClaimResult(boolean claimed, int attempts, NameChangeResult finalResult, ClaimResult.StopReason stopReason, Optional<AltsFailure> failure)
extends Record
What a scheduled name claim came to.
claimed answers "did I get the name"; stopReason answers "why did the run end",
which a host needs separately. A run that ran out its window, one that met a failure that ends it (a
refused token, an account with nothing to rename, a rate limit, a closed runtime), and one the caller
cancelled all end with claimed == false, and each calls for something different next.
- Since:
- 0.11.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhy a scheduled claim stopped. -
Constructor Summary
ConstructorsConstructorDescriptionClaimResult(boolean claimed, int attempts, NameChangeResult finalResult, ClaimResult.StopReason stopReason, Optional<AltsFailure> failure) Checks that a failure is present exactly onClaimResult.StopReason.TERMINAL_FAILURE. -
Method Summary
Modifier and TypeMethodDescriptionintattempts()Returns the value of theattemptsrecord component.booleanclaimed()Returns the value of theclaimedrecord component.final booleanIndicates whether some other object is "equal to" this one.failure()Returns the value of thefailurerecord component.Returns the value of thefinalResultrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of thestopReasonrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ClaimResult
public ClaimResult(boolean claimed, int attempts, NameChangeResult finalResult, ClaimResult.StopReason stopReason, Optional<AltsFailure> failure) Checks that a failure is present exactly onClaimResult.StopReason.TERMINAL_FAILURE.- Throws:
NullPointerException- ifstopReasonorfailureis nullIllegalArgumentException- if the failure does not match the stop reason- Since:
- 1.0.0
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
claimed
-
attempts
-
finalResult
Returns the value of thefinalResultrecord component.- Returns:
- the value of the
finalResultrecord component
-
stopReason
Returns the value of thestopReasonrecord component.- Returns:
- the value of the
stopReasonrecord component
-
failure
-