Class EntitlementImpl
java.lang.Object
net.dv8tion.jda.internal.entities.EntitlementImpl
- All Implemented Interfaces:
Entitlement
,ISnowflake
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.dv8tion.jda.api.entities.Entitlement
Entitlement.EntitlementType
-
Constructor Summary
ConstructorsConstructorDescriptionEntitlementImpl
(JDA api, long id, long skuId, long applicationId, long userId, long guildId, Entitlement.EntitlementType type, boolean deleted, OffsetDateTime startsAt, OffsetDateTime endsAt, boolean consumed) -
Method Summary
Modifier and TypeMethodDescriptionconsume()
Consumes theEntitlement
if it has not already been consumed.long
The id of the parent application of thisEntitlement
long
The guild id that is granted access to theEntitlement
s SKUlong
The Snowflake id of this entity.long
The id of the SKU related to thisEntitlement
Date at which theEntitlement
is no longer valid.The start date at which theEntitlement
is valid.getType()
The type of the Entitlementlong
The id of the user that purchased theEntitlement
boolean
Whether theEntitlement
was consumed or not.boolean
Whether theEntitlement
has been deleted or not.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.dv8tion.jda.api.entities.Entitlement
getApplicationId, getGuildId, getSkuId, getUserId
Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getTimeCreated
-
Constructor Details
-
EntitlementImpl
public EntitlementImpl(JDA api, long id, long skuId, long applicationId, long userId, long guildId, Entitlement.EntitlementType type, boolean deleted, @Nullable OffsetDateTime startsAt, @Nullable OffsetDateTime endsAt, boolean consumed)
-
-
Method Details
-
getIdLong
public long getIdLong()Description copied from interface:ISnowflake
The Snowflake id of this entity. This is unique to every entity and will never change.- Specified by:
getIdLong
in interfaceISnowflake
- Returns:
- Long containing the Id.
-
getSkuIdLong
public long getSkuIdLong()Description copied from interface:Entitlement
The id of the SKU related to thisEntitlement
- Specified by:
getSkuIdLong
in interfaceEntitlement
- Returns:
- The id of the SKU related to this
Entitlement
-
getApplicationIdLong
public long getApplicationIdLong()Description copied from interface:Entitlement
The id of the parent application of thisEntitlement
- Specified by:
getApplicationIdLong
in interfaceEntitlement
- Returns:
- The id of the parent application of this
Entitlement
-
getUserIdLong
public long getUserIdLong()Description copied from interface:Entitlement
The id of the user that purchased theEntitlement
- Specified by:
getUserIdLong
in interfaceEntitlement
- Returns:
- The id of the user that purchased the
Entitlement
-
getGuildIdLong
public long getGuildIdLong()Description copied from interface:Entitlement
The guild id that is granted access to theEntitlement
s SKU- Specified by:
getGuildIdLong
in interfaceEntitlement
- Returns:
- The id of the guild that purchased the
Entitlement
or 0 if this is not a guild subscription
-
getType
Description copied from interface:Entitlement
The type of the Entitlement- Specified by:
getType
in interfaceEntitlement
- Returns:
- the
Entitlement
type
-
isDeleted
public boolean isDeleted()Description copied from interface:Entitlement
Whether theEntitlement
has been deleted or not.- Specified by:
isDeleted
in interfaceEntitlement
- Returns:
- True if the
Entitlement
was deleted, False otherwise - See Also:
-
getTimeStarting
Description copied from interface:Entitlement
The start date at which theEntitlement
is valid.- Specified by:
getTimeStarting
in interfaceEntitlement
- Returns:
- Start date at which the
Entitlement
is valid. Not present when using test entitlements.
-
getTimeEnding
Description copied from interface:Entitlement
Date at which theEntitlement
is no longer valid.- Specified by:
getTimeEnding
in interfaceEntitlement
- Returns:
- Date at which the
Entitlement
is no longer valid. Not present when using test entitlements.
-
isConsumed
public boolean isConsumed()Description copied from interface:Entitlement
Whether theEntitlement
was consumed or not.- Specified by:
isConsumed
in interfaceEntitlement
- Returns:
- True if the
Entitlement
was consumed, False otherwise
-
consume
Description copied from interface:Entitlement
Consumes theEntitlement
if it has not already been consumed.
Only One-Time Purchase consumableEntitlements
can be consumed.
After theEntitlement
has been consumed, it will be marked as consumed.- Specified by:
consume
in interfaceEntitlement
- Returns:
- A
RestAction
that will consume theEntitlement
-