Record Class NameChangeResult

java.lang.Object
java.lang.Record
lol.trq.alts.account.NameChangeResult
Record Components:
outcome - the classified result
profile - the updated profile on success, or null
message - a short description built by the library; on a failure, the failure's message
failure - why the change failed, present exactly when the outcome is NameChangeResult.Outcome.FAILED; carried since 1.0.0 in place of the former wait

public record NameChangeResult(NameChangeResult.Outcome outcome, PlayerProfile profile, String message, Optional<AltsFailure> failure) extends Record
What a name change came to.

The mutation's status carries the meaning: a 400 is a malformed or invalid name and a 403 is the name being unavailable or the account on cooldown, which are outcomes a host shows the user. A refused token, an account that owns no Java to rename, a rate limit and an unreachable service are failures: NameChangeResult.Outcome.FAILED, with failure() saying which kind and carrying any stated wait.

Since:
0.11.0
  • Constructor Details

  • Method Details

    • failed

      public static NameChangeResult failed(AltsFailure failure)
      Creates a failed result whose message is the failure's.
      Parameters:
      failure - why the change failed
      Returns:
      the result
      Since:
      1.0.0
    • success

      public boolean success()
      Returns whether the name was changed.
      Returns:
      true on success
      Since:
      0.11.0
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • outcome

      public NameChangeResult.Outcome outcome()
      Returns the value of the outcome record component.
      Returns:
      the value of the outcome record component
    • profile

      public PlayerProfile profile()
      Returns the value of the profile record component.
      Returns:
      the value of the profile record component
    • message

      public String message()
      Returns the value of the message record component.
      Returns:
      the value of the message record component
    • failure

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