Class MoneyImpl

java.lang.Object
com.commercetools.api.models.common.MoneyImpl
All Implemented Interfaces:
MonetaryAmountConvertable, Money, io.vrap.rmf.base.client.ModelBase, Comparable<javax.money.MonetaryAmount>, javax.money.CurrencySupplier, javax.money.MonetaryAmount, javax.money.NumberSupplier

public class MoneyImpl extends Object implements Money, io.vrap.rmf.base.client.ModelBase

Draft type that stores amounts in cent precision for the specified currency.

For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

  • Constructor Details

    • MoneyImpl

      public MoneyImpl()
  • Method Details

    • getCentAmount

      public Long getCentAmount()

      Amount in the smallest indivisible unit of a currency, such as:

      • Cents for EUR and USD, pence for GBP, or centime for CHF (5 CHF is specified as 500).
      • The value in the major unit for currencies without minor units, like JPY (5 JPY is specified as 5).
      Specified by:
      getCentAmount in interface Money
      Returns:
      centAmount
    • getCurrencyCode

      public String getCurrencyCode()

      Currency code compliant to ISO 4217.

      Specified by:
      getCurrencyCode in interface Money
      Returns:
      currencyCode
    • setCentAmount

      public void setCentAmount(Long centAmount)
      Specified by:
      setCentAmount in interface Money
    • setCurrencyCode

      public void setCurrencyCode(String currencyCode)
      Specified by:
      setCurrencyCode in interface Money
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object