Interface PurchasedProduct
-
- All Superinterfaces:
PrettyPrintable
public interface PurchasedProduct extends PrettyPrintable
The interface that represents a purchased product.
You can receive this object from the purchases list in thePayment
.- Author:
- soknight
- See Also:
Payment.getProducts()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull List<FilledAdditionalField>
getAdditionalFields()
Get the list of filled additional fields for this purchase.long
getBoughtAmount()
Get the actual bought amount of the purchased product.@NotNull List<String>
getCommands()
Get the in-game commands that will be sent after purchase of this product.@NotNull LocalDateTime
getCreatedAt()
Get the creation date of this purchase.long
getDefaultAmount()
Get the default amount of the purchased product.@NotNull Optional<String>
getDescription()
Get the optional-wrapped description of the purchased product.@NotNull Optional<Discounts>
getDiscounts()
Get the optional-wrapped applied discounts of this purchase.@NotNull String
getIconImage()
Get the icon image of the purchased product.int
getId()
Get the ID of this purchase.@NotNull String
getName()
Get the name of the purchased product.@NotNull OptionalDouble
getOldPrice()
Get the optional-wrapped old price of the purchased product.int
getPaymentId()
Get the ID of the related payment.double
getPrice()
Get the price of this purchase.int
getProductId()
Get the ID of the purchased product.@NotNull ProductType
getType()
Get the type of the purchased product.@NotNull String
getTypeRaw()
Get the raw type of the purchased product.@NotNull LocalDateTime
getUpdatedAt()
Get a date of the last purchase update.boolean
isOneTimePurchasable()
Check is the purchased product may be purchased only one time or not.-
Methods inherited from interface ru.easydonate.easydonate4j.data.model.PrettyPrintable
toPrettyString
-
-
-
-
Method Detail
-
getId
int getId()
Get the ID of this purchase.- Returns:
- The purchase ID.
-
getProductId
int getProductId()
Get the ID of the purchased product.- Returns:
- The purchased product ID.
-
getPaymentId
int getPaymentId()
Get the ID of the related payment.- Returns:
- The purchase payment ID.
-
getName
@NotNull @NotNull String getName()
Get the name of the purchased product.- Returns:
- The purchased product name.
-
getType
@NotNull @NotNull ProductType getType()
Get the type of the purchased product.- Returns:
- The purchased product type.
- See Also:
ProductType
-
getTypeRaw
@NotNull @NotNull String getTypeRaw()
Get the raw type of the purchased product.
Can be used when thegetType()
method has returned the unknown constant.- Returns:
- The raw purchased product type.
- See Also:
getType()
-
getPrice
double getPrice()
Get the price of this purchase.- Returns:
- The purchase price.
-
getDefaultAmount
long getDefaultAmount()
Get the default amount of the purchased product.- Returns:
- The purchased product default amount.
-
getBoughtAmount
long getBoughtAmount()
Get the actual bought amount of the purchased product.- Returns:
- The purchased product amount.
-
getDescription
@NotNull @NotNull Optional<String> getDescription()
Get the optional-wrapped description of the purchased product.- Returns:
- The optional-wrapped purchased product description.
-
getOldPrice
@NotNull @NotNull OptionalDouble getOldPrice()
Get the optional-wrapped old price of the purchased product.- Returns:
- The optional-wrapped purchased product old price.
-
getIconImage
@NotNull @NotNull String getIconImage()
Get the icon image of the purchased product.
Usually it's just a direct link to image hosted by platform servers.- Returns:
- The purchased product icon image.
-
isOneTimePurchasable
boolean isOneTimePurchasable()
Check is the purchased product may be purchased only one time or not.
After the first purchase of this product will be hidden from the shop.- Returns:
- A boolean value: the check result.
-
getCommands
@NotNull @NotNull List<String> getCommands()
Get the in-game commands that will be sent after purchase of this product.- Returns:
- The purchased product configured list of commands.
- See Also:
Payment.getSentCommands()
-
getAdditionalFields
@NotNull @NotNull List<FilledAdditionalField> getAdditionalFields()
Get the list of filled additional fields for this purchase.- Returns:
- The purchased product filled additional fields.
- See Also:
FilledAdditionalField
-
getDiscounts
@NotNull @NotNull Optional<Discounts> getDiscounts()
Get the optional-wrapped applied discounts of this purchase.
Sometimes a coupon discount or a mass sale discount may be here.- Returns:
- The optional-wrapped purchase discounts.
- See Also:
Discounts
,CouponDiscount
,MassSaleDiscount
-
getCreatedAt
@NotNull @NotNull LocalDateTime getCreatedAt()
Get the creation date of this purchase.- Returns:
- The purchase creation date.
-
getUpdatedAt
@NotNull @NotNull LocalDateTime getUpdatedAt()
Get a date of the last purchase update.- Returns:
- The last purchase update date.
-
-