Record Class PlayerProfile

java.lang.Object
java.lang.Record
lol.trq.alts.account.PlayerProfile
Record Components:
uuid - the account UUID (undashed, as the endpoint returns it)
name - the current username
skins - the skins on the account, at most one Skin.State.ACTIVE
capes - the capes the account owns, at most one Cape.State.ACTIVE
profileActions - pending moderation actions (empty for an account in good standing)

public record PlayerProfile(String uuid, String name, List<Skin> skins, List<Cape> capes, List<String> profileActions) extends Record
A player's full Minecraft profile as GET /minecraft/profile returns it — not just the name and UUID an authentication flow needs, but the skins, capes, and any pending moderation actions on the account.

Distinct from the identity a sign-in resolves, which reaches a host as the account on its LoginResult. This is the read a host performs on a live account to show what it looks like and owns.

Since:
0.11.0
  • Constructor Details

    • PlayerProfile

      public PlayerProfile(String uuid, String name, List<Skin> skins, List<Cape> capes, List<String> profileActions)
      Normalises the collections to non-null empties, so a caller never has to null-check them.
      Since:
      0.11.0
  • Method Details

    • activeSkin

      public Skin activeSkin()
      Returns the active skin, if the account has one.
      Returns:
      the active skin, or null when none is active
      Since:
      0.11.0
    • activeCape

      public Cape activeCape()
      Returns the active cape, if the account has one shown.
      Returns:
      the active cape, or null when none is active
      Since:
      0.11.0
    • hasPendingActions

      public boolean hasPendingActions()
      Returns whether the account carries any pending moderation action, which a host may want to warn about before relying on the account.
      Returns:
      true if a profile action is pending
      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.
    • uuid

      @SerializedName("id") public String uuid()
      Returns the value of the uuid record component.
      Returns:
      the value of the uuid record component
    • name

      @SerializedName("name") public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • skins

      @SerializedName("skins") public List<Skin> skins()
      Returns the value of the skins record component.
      Returns:
      the value of the skins record component
    • capes

      @SerializedName("capes") public List<Cape> capes()
      Returns the value of the capes record component.
      Returns:
      the value of the capes record component
    • profileActions

      @SerializedName("profileActions") public List<String> profileActions()
      Returns the value of the profileActions record component.
      Returns:
      the value of the profileActions record component