Record Class Entitlements

java.lang.Object
java.lang.Record
lol.trq.alts.account.Entitlements
Record Components:
products - the product ids the account holds

public record Entitlements(Set<String> products) extends Record
What an account owns, from GET /entitlements/mcstore.

Not a boolean. The endpoint returns a set of named products, and the distinctions in it are ones an alt manager cares about: an account that owns Java outright is not the same as one entitled only through a Game Pass that can lapse, and "owns Minecraft" hides that. The raw product ids are kept so a host can read one this release has not named, and the helpers cover the common questions.

Since:
0.11.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Product id for Minecraft Bedrock.
    static final String
    Product id for Minecraft Dungeons.
    static final String
    Product id for entitlement via Xbox Game Pass (PC).
    static final String
    Product id for entitlement via Xbox Game Pass Ultimate.
    static final String
    Product id for Minecraft: Java Edition owned outright.
    static final String
    Product id for Minecraft Legends.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Entitlements(Set<String> products)
    Copies the product set defensively.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    boolean
    Returns whether the account holds no products at all — authenticated, but owns nothing.
    boolean
    Returns whether the account owns Bedrock.
    boolean
    Returns whether the account can play Java — whether it owns it outright or is entitled through a Game Pass.
    boolean
    Returns whether the account owns Java outright, independent of any Game Pass.
    Returns the value of the products record component.
    final String
    Returns a string representation of this record class.
    boolean
    Returns whether the account's entitlement runs through a Game Pass, which can lapse — a materially weaker claim than owning the game, and worth surfacing separately.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • PRODUCT_JAVA

      public static final String PRODUCT_JAVA
      Product id for Minecraft: Java Edition owned outright.
      Since:
      0.11.0
      See Also:
    • PRODUCT_BEDROCK

      public static final String PRODUCT_BEDROCK
      Product id for Minecraft Bedrock.
      Since:
      0.11.0
      See Also:
    • PRODUCT_GAME_PASS_ULTIMATE

      public static final String PRODUCT_GAME_PASS_ULTIMATE
      Product id for entitlement via Xbox Game Pass Ultimate.
      Since:
      0.11.0
      See Also:
    • PRODUCT_GAME_PASS_PC

      public static final String PRODUCT_GAME_PASS_PC
      Product id for entitlement via Xbox Game Pass (PC).
      Since:
      0.11.0
      See Also:
    • PRODUCT_LEGENDS

      public static final String PRODUCT_LEGENDS
      Product id for Minecraft Legends.
      Since:
      0.11.0
      See Also:
    • PRODUCT_DUNGEONS

      public static final String PRODUCT_DUNGEONS
      Product id for Minecraft Dungeons.
      Since:
      0.11.0
      See Also:
  • Constructor Details

    • Entitlements

      public Entitlements(Set<String> products)
      Copies the product set defensively.
      Since:
      0.11.0
  • Method Details

    • ownsJava

      public boolean ownsJava()
      Returns whether the account can play Java — whether it owns it outright or is entitled through a Game Pass. This is the "can it log into a Java server" question.
      Returns:
      true if Java is playable
      Since:
      0.11.0
    • ownsJavaOutright

      public boolean ownsJavaOutright()
      Returns whether the account owns Java outright, independent of any Game Pass.
      Returns:
      true if Java is owned directly
      Since:
      0.11.0
    • ownsBedrock

      public boolean ownsBedrock()
      Returns whether the account owns Bedrock.
      Returns:
      true if Bedrock is owned
      Since:
      0.11.0
    • viaGamePass

      public boolean viaGamePass()
      Returns whether the account's entitlement runs through a Game Pass, which can lapse — a materially weaker claim than owning the game, and worth surfacing separately.
      Returns:
      true if entitled through a Game Pass tier
      Since:
      0.11.0
    • isEmpty

      public boolean isEmpty()
      Returns whether the account holds no products at all — authenticated, but owns nothing.
      Returns:
      true if the product set is empty
      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.
    • products

      public Set<String> products()
      Returns the value of the products record component.
      Returns:
      the value of the products record component