Record Class ProfileCreationResult

java.lang.Object
java.lang.Record
lol.trq.alts.account.ProfileCreationResult
Record Components:
outcome - the classified result
profile - the new profile on success, or null
message - a short description built by the library; on a failure, the failure's message
failure - why the creation failed, present exactly when the outcome is ProfileCreationResult.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
  • Constructor Details

  • Method Details

    • failed

      public static ProfileCreationResult failed(AltsFailure failure)
      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

      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

      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