Class CentPrecisionMoneyImpl

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

public class CentPrecisionMoneyImpl extends Object implements CentPrecisionMoney, io.vrap.rmf.base.client.ModelBase

Object that stores cent amounts in a specific currency.

  • Constructor Details

    • CentPrecisionMoneyImpl

      public CentPrecisionMoneyImpl()
      create empty instance
  • 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
    • getType

      public MoneyType getType()

      Type of money used.

      Specified by:
      getType in interface TypedMoney
      Returns:
      type
    • getFractionDigits

      public Integer getFractionDigits()

      The number of default fraction digits for the given currency, like 2 for EUR or 0 for JPY.

      Specified by:
      getFractionDigits in interface CentPrecisionMoney
      Specified by:
      getFractionDigits in interface TypedMoney
      Returns:
      fractionDigits
    • setCentAmount

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

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

      public void setFractionDigits(Integer fractionDigits)
      Description copied from interface: CentPrecisionMoney

      The number of default fraction digits for the given currency, like 2 for EUR or 0 for JPY.

      Specified by:
      setFractionDigits in interface CentPrecisionMoney
      Specified by:
      setFractionDigits in interface TypedMoney
      Parameters:
      fractionDigits - value to be set
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object