Class HighPrecisionMoneyImpl
java.lang.Object
com.commercetools.api.models.common.HighPrecisionMoneyImpl
- All Implemented Interfaces:
HighPrecisionMoney
,MonetaryAmountConvertable
,Money
,TypedMoney
,io.vrap.rmf.base.client.ModelBase
,Comparable<javax.money.MonetaryAmount>
,javax.money.CurrencySupplier
,javax.money.MonetaryAmount
,javax.money.NumberSupplier
public class HighPrecisionMoneyImpl
extends Object
implements HighPrecisionMoney, io.vrap.rmf.base.client.ModelBase
Money object that stores an amount of a fraction of the smallest indivisible unit of the specified 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.HighPrecisionMoney
HIGH_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.Number of digits after the decimal separator, greater than the default number of fraction digits for a currency.Amount in 1 / (10 ^fractionDigits
) of a currency.getType()
Type of money used.int
hashCode()
void
setCentAmount
(Long centAmount) void
setCurrencyCode
(String currencyCode) void
setFractionDigits
(Integer fractionDigits) Number of digits after the decimal separator, greater than the default number of fraction digits for a currency.void
setPreciseAmount
(Long preciseAmount) Amount in 1 / (10 ^fractionDigits
) of a currency.Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.commercetools.api.models.common.HighPrecisionMoney
createMoneyOperator, toDraft, withHighPrecisionMoney
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
withTypedMoney
-
Constructor Details
-
HighPrecisionMoneyImpl
public HighPrecisionMoneyImpl()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
Number of digits after the decimal separator, greater than the default number of fraction digits for a currency.
- Specified by:
getFractionDigits
in interfaceHighPrecisionMoney
- Specified by:
getFractionDigits
in interfaceTypedMoney
- Returns:
- fractionDigits
-
getPreciseAmount
Amount in 1 / (10 ^
fractionDigits
) of a currency.- Specified by:
getPreciseAmount
in interfaceHighPrecisionMoney
- Returns:
- preciseAmount
-
setCentAmount
- Specified by:
setCentAmount
in interfaceMoney
-
setCurrencyCode
- Specified by:
setCurrencyCode
in interfaceMoney
-
setFractionDigits
Description copied from interface:HighPrecisionMoney
Number of digits after the decimal separator, greater than the default number of fraction digits for a currency.
- Specified by:
setFractionDigits
in interfaceHighPrecisionMoney
- Specified by:
setFractionDigits
in interfaceTypedMoney
- Parameters:
fractionDigits
- value to be set
-
setPreciseAmount
Description copied from interface:HighPrecisionMoney
Amount in 1 / (10 ^
fractionDigits
) of a currency.- Specified by:
setPreciseAmount
in interfaceHighPrecisionMoney
- Parameters:
preciseAmount
- value to be set
-
equals
-
hashCode
-