Enum SKUFlag

java.lang.Object
java.lang.Enum<SKUFlag>
net.dv8tion.jda.api.entities.SKUFlag
All Implemented Interfaces:
Serializable, Comparable<SKUFlag>

public enum SKUFlag extends Enum<SKUFlag>
SKU Flag exposing metadata for a SKU. They define the scope and availability of a SKU.
  • Enum Constant Details

    • AVAILABLE

      public static final SKUFlag AVAILABLE
      SKU is available for purchase
    • GUILD_SUBSCRIPTION

      public static final SKUFlag GUILD_SUBSCRIPTION
      Recurring SKU that can be purchased by a user and applied to a single server. Grants access to every user in that server.
    • USER_SUBSCRIPTION

      public static final SKUFlag USER_SUBSCRIPTION
      Recurring SKU purchased by a user for themselves. Grants access to the purchasing user in every server.
  • Method Details

    • values

      public static SKUFlag[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static SKUFlag valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getRaw

      public int getRaw()
      The raw value used by Discord for this flag.
      Returns:
      The raw value
    • getOffset

      public int getOffset()
      The bit offset used to identify this flag.
      Returns:
      The bit offset
    • getFlags

      @Nonnull public static EnumSet<SKUFlag> getFlags(int flags)
      Converts a bitmask representation of SKU flags into its EnumSet.
      Parameters:
      flags - The raw bitmask representing the SKU flags
      Returns:
      An EnumSet of SKU flags represented by the input bitmask.