Record Class ClaimResult

java.lang.Object
java.lang.Record
lol.trq.alts.account.ClaimResult
Record Components:
claimed - whether the name was taken
attempts - how many change attempts were made
finalResult - 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; null when no attempt was made
stopReason - why the run ended; added in 0.12.0
failure - what ended the run, present exactly when the stop reason is ClaimResult.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
  • Constructor Details

  • Method Details

    • 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 the compare method from their corresponding wrapper classes.
      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.
    • claimed

      public boolean claimed()
      Returns the value of the claimed record component.
      Returns:
      the value of the claimed record component
    • attempts

      public int attempts()
      Returns the value of the attempts record component.
      Returns:
      the value of the attempts record component
    • finalResult

      public NameChangeResult finalResult()
      Returns the value of the finalResult record component.
      Returns:
      the value of the finalResult record component
    • stopReason

      public ClaimResult.StopReason stopReason()
      Returns the value of the stopReason record component.
      Returns:
      the value of the stopReason record component
    • failure

      public Optional<AltsFailure> failure()
      Returns the value of the failure record component.
      Returns:
      the value of the failure record component