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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.vrap.rmf.base.client.ModelBase
io.vrap.rmf.base.client.ModelBase.FilteredRecursiveToStringStyle
-
Field Summary
Fields inherited from interface com.commercetools.api.models.common.CentPrecisionMoney
CENT_PRECISION
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Amount in the smallest indivisible unit of a currency, such as:Currency code compliant to ISO 4217.The number of default fraction digits for the given currency, like2
for EUR or0
for JPY.getType()
Type of money used.int
hashCode()
void
setCentAmount
(Long centAmount) void
setCurrencyCode
(String currencyCode) void
setFractionDigits
(Integer fractionDigits) The number of default fraction digits for the given currency, like2
for EUR or0
for JPY.Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.commercetools.api.models.common.CentPrecisionMoney
toDraft, withCentPrecisionMoney
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, 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, with, withMoney
Methods inherited from interface com.commercetools.api.models.common.TypedMoney
createMoneyOperator, withTypedMoney
-
Constructor Details
-
CentPrecisionMoneyImpl
public CentPrecisionMoneyImpl()create empty instance
-
-
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
-
getType
Type of money used.
- Specified by:
getType
in interfaceTypedMoney
- Returns:
- type
-
getFractionDigits
The number of default fraction digits for the given currency, like
2
for EUR or0
for JPY.- Specified by:
getFractionDigits
in interfaceCentPrecisionMoney
- Specified by:
getFractionDigits
in interfaceTypedMoney
- Returns:
- fractionDigits
-
setCentAmount
- Specified by:
setCentAmount
in interfaceMoney
-
setCurrencyCode
- Specified by:
setCurrencyCode
in interfaceMoney
-
setFractionDigits
Description copied from interface:CentPrecisionMoney
The number of default fraction digits for the given currency, like
2
for EUR or0
for JPY.- Specified by:
setFractionDigits
in interfaceCentPrecisionMoney
- Specified by:
setFractionDigits
in interfaceTypedMoney
- Parameters:
fractionDigits
- value to be set
-
equals
-
hashCode
public int hashCode()
-