Package net.dv8tion.jda.api.entities
Enum Entitlement.EntitlementType
java.lang.Object
java.lang.Enum<Entitlement.EntitlementType>
net.dv8tion.jda.api.entities.Entitlement.EntitlementType
- All Implemented Interfaces:
Serializable
,Comparable<Entitlement.EntitlementType>
- Enclosing interface:
- Entitlement
Represents the type of this Entitlement
-
Enum Constant Summary
Enum ConstantDescriptionEntitlement was purchased as an app subscriptionEntitlement was gifted by developerEntitlement was granted when the SKU was freeEntitlement was claimed by user for free as a Nitro SubscriberEntitlement for Discord Nitro subscriptionEntitlement was purchased by userEntitlement was purchased by a dev in application test modePlaceholder for unsupported types.Entitlement was gifted by another user -
Method Summary
Modifier and TypeMethodDescriptionstatic Entitlement.EntitlementType
fromKey
(int key) Gets the EntitlementType related to the provided key.int
getKey()
The Discord defined id key for this EntitlementType.static Entitlement.EntitlementType
Returns the enum constant of this type with the specified name.static Entitlement.EntitlementType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
PURCHASE
Entitlement was purchased by user -
PREMIUM_SUBSCRIPTION
Entitlement for Discord Nitro subscription -
DEVELOPER_GIFT
Entitlement was gifted by developer -
TEST_MODE_PURCHASE
Entitlement was purchased by a dev in application test mode -
FREE_PURCHASE
Entitlement was granted when the SKU was free -
USER_GIFT
Entitlement was gifted by another user -
PREMIUM_PURCHASE
Entitlement was claimed by user for free as a Nitro Subscriber -
APPLICATION_SUBSCRIPTION
Entitlement was purchased as an app subscription -
UNKNOWN
Placeholder for unsupported types.
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
getKey
public int getKey()The Discord defined id key for this EntitlementType.- Returns:
- the id key.
-
fromKey
Gets the EntitlementType related to the provided key.
If an unknown key is provided, this returnsUNKNOWN
- Parameters:
key
- The Discord key referencing a EntitlementType.- Returns:
- The EntitlementType that has the key provided, or
UNKNOWN
for unknown key.
-