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
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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.vrap.rmf.base.client.ModelBase
io.vrap.rmf.base.client.ModelBase.FilteredRecursiveToStringStyle
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Amount in the smallest indivisible unit of a currency, such as:Currency code compliant to ISO 4217.int
hashCode()
void
setCentAmount
(Long centAmount) void
setCurrencyCode
(String currencyCode) Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.vrap.rmf.base.client.ModelBase
reflectionString, reflectionString
Methods inherited from interface javax.money.MonetaryAmount
isNegative, isNegativeOrZero, isPositive, isPositiveOrZero, isZero
Methods inherited from interface com.commercetools.api.models.common.MonetaryAmountConvertable
toMonetaryAmount
Methods inherited from interface com.commercetools.api.models.common.Money
abs, add, compareTo, createMoneyOperator, divide, divide, divide, divideAndRemainder, divideAndRemainder, divideAndRemainder, divideToIntegralValue, divideToIntegralValue, divideToIntegralValue, getContext, getCurrency, getFactory, getNumber, isEqualTo, isGreaterThan, isGreaterThanOrEqualTo, isLessThan, isLessThanOrEqualTo, multiply, multiply, multiply, negate, plus, query, remainder, remainder, remainder, scaleByPowerOfTen, signum, stripTrailingZeros, subtract, toDraft, with, withMoney
-
Constructor Details
-
MoneyImpl
public MoneyImpl()
-
-
Method Details
-
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 interfaceMoney
- Returns:
- centAmount
- Cents for EUR and USD, pence for GBP, or centime for CHF (5 CHF is specified as
-
getCurrencyCode
Currency code compliant to ISO 4217.
- Specified by:
getCurrencyCode
in interfaceMoney
- Returns:
- currencyCode
-
setCentAmount
- Specified by:
setCentAmount
in interfaceMoney
-
setCurrencyCode
- Specified by:
setCurrencyCode
in interfaceMoney
-
equals
-
hashCode
-