Record Class ProfileCreationResult
java.lang.Object
java.lang.Record
lol.trq.alts.account.ProfileCreationResult
- Record Components:
outcome- the classified resultprofile- the new profile on success, ornullmessage- a short description built by the library; on a failure, the failure's messagefailure- why the creation failed, present exactly when the outcome isProfileCreationResult.Outcome.FAILED; carried since 1.0.0 in place of the former wait
public record ProfileCreationResult(ProfileCreationResult.Outcome outcome, PlayerProfile profile, String message, Optional<AltsFailure> failure)
extends Record
What creating a profile came to.
Like a name change, this is a mutation whose refusals are outcomes rather than errors: a taken name
and a blocked one are things a host shows the user. An account that owns nothing, a refused token, a
rate limit and an unreachable service are failures: ProfileCreationResult.Outcome.FAILED, with failure()
saying which kind and carrying any stated wait.
- Since:
- 0.12.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumHow a profile creation ended. -
Constructor Summary
ConstructorsConstructorDescriptionProfileCreationResult(ProfileCreationResult.Outcome outcome, PlayerProfile profile, String message, Optional<AltsFailure> failure) Checks that a failure is present exactly onProfileCreationResult.Outcome.FAILED. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static ProfileCreationResultfailed(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 profile was created.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ProfileCreationResult
public ProfileCreationResult(ProfileCreationResult.Outcome outcome, PlayerProfile profile, String message, Optional<AltsFailure> failure) Checks that a failure is present exactly onProfileCreationResult.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 creation failed- Returns:
- the result
- Since:
- 1.0.0
-
success
public boolean success()Returns whether the profile was created.- Returns:
- true on success
- Since:
- 0.12.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
-