Record Class NameChangeResult
java.lang.Object
java.lang.Record
lol.trq.alts.account.NameChangeResult
- Record Components:
outcome- the classified resultprofile- the updated profile on success, ornullmessage- a short description built by the library; on a failure, the failure's messagefailure- why the change failed, present exactly when the outcome isNameChangeResult.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
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionNameChangeResult(NameChangeResult.Outcome outcome, PlayerProfile profile, String message, Optional<AltsFailure> failure) Checks that a failure is present exactly onNameChangeResult.Outcome.FAILED. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static NameChangeResultfailed(AltsFailure failure) Creates a failed result whose message is the failure's.failure()Returns the value of thefailurerecord component.final inthashCode()Returns a hash code value for this object.message()Returns the value of themessagerecord component.outcome()Returns the value of theoutcomerecord component.profile()Returns the value of theprofilerecord component.booleansuccess()Returns whether the name was changed.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
NameChangeResult
public NameChangeResult(NameChangeResult.Outcome outcome, PlayerProfile profile, String message, Optional<AltsFailure> failure) Checks that a failure is present exactly onNameChangeResult.Outcome.FAILED.- Throws:
NullPointerException- ifoutcomeorfailureis nullIllegalArgumentException- if the failure does not match the outcome- Since:
- 1.0.0
-
-
Method Details
-
failed
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
-
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). -
outcome
-
profile
-
message
-
failure
-