Package com.github.twitch4j.common.util
Class DonationAmount
java.lang.Object
com.github.twitch4j.common.util.DonationAmount
-
Constructor Summary
ConstructorDescriptionDonationAmount
(Long value, Integer decimalPlaces, String currency) Creates a newDonationAmount
instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
The ISO-4217 three-letter currency code that identifies the type of currency ingetValue()
.The number of decimal places used by the currency.TheCurrency
corresponding to the ISO-4217 code contained ingetCurrency()
.The donation amount, with the appropriate decimals, based ongetValue()
.getValue()
The monetary amount.int
hashCode()
toString()
-
Constructor Details
-
DonationAmount
public DonationAmount() -
DonationAmount
Creates a newDonationAmount
instance.- Parameters:
value
- The monetary amount.The amount is specified in the currency’s minor unit.
For example, the minor units for USD is cents, so if the amount is $5.50 USD, value is set to 550.
decimalPlaces
- The number of decimal places used by the currency.For example, USD uses two decimal places.
currency
- The ISO-4217 three-letter currency code that identifies the type of currency ingetValue()
.
-
-
Method Details
-
getValue
The monetary amount.The amount is specified in the currency’s minor unit.
For example, the minor units for USD is cents, so if the amount is $5.50 USD, value is set to 550.
-
getDecimalPlaces
The number of decimal places used by the currency.For example, USD uses two decimal places.
-
getCurrency
The ISO-4217 three-letter currency code that identifies the type of currency ingetValue()
. -
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-
getParsedCurrency
TheCurrency
corresponding to the ISO-4217 code contained ingetCurrency()
. -
getParsedValue
The donation amount, with the appropriate decimals, based ongetValue()
.
-