Class DonationAmount

java.lang.Object
com.github.twitch4j.common.util.DonationAmount

public class DonationAmount extends Object
  • Constructor Details

    • DonationAmount

      public DonationAmount()
    • DonationAmount

      public DonationAmount(Long value, Integer decimalPlaces, String currency)
      Creates a new DonationAmount 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 in getValue().
  • Method Details

    • getValue

      public Long 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

      public Integer getDecimalPlaces()
      The number of decimal places used by the currency.

      For example, USD uses two decimal places.

    • getCurrency

      public String getCurrency()
      The ISO-4217 three-letter currency code that identifies the type of currency in getValue().
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getParsedCurrency

      public Currency getParsedCurrency()
      The Currency corresponding to the ISO-4217 code contained in getCurrency().
    • getParsedValue

      public BigDecimal getParsedValue()
      The donation amount, with the appropriate decimals, based on getValue().