Class HighPrecisionMoneyDraftImpl
- All Implemented Interfaces:
HighPrecisionMoneyDraft
,MonetaryAmountConvertable
,Money
,TypedMoneyDraft
,io.vrap.rmf.base.client.Draft<HighPrecisionMoneyDraft>
,io.vrap.rmf.base.client.ModelBase
,Comparable<javax.money.MonetaryAmount>
,javax.money.CurrencySupplier
,javax.money.MonetaryAmount
,javax.money.NumberSupplier
Money draft object to store 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.HighPrecisionMoneyDraft
HIGH_PRECISION
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Amount in the smallest indivisible unit of a currency.Currency code compliant to ISO 4217.Number of fraction digits for a specified high precision money.Amount in 1 / (10 ^fractionDigits
) of a currency.getType()
int
hashCode()
void
setCentAmount
(Long centAmount) Amount in the smallest indivisible unit of a currency.void
setCurrencyCode
(String currencyCode) void
setFractionDigits
(Integer fractionDigits) Number of fraction digits for a specified high precision money.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.HighPrecisionMoneyDraft
createMoneyOperator, withHighPrecisionMoneyDraft
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, toDraft, with, withMoney
Methods inherited from interface com.commercetools.api.models.common.TypedMoneyDraft
withTypedMoneyDraft
-
Constructor Details
-
HighPrecisionMoneyDraftImpl
public HighPrecisionMoneyDraftImpl()create empty instance
-
-
Method Details
-
getCentAmount
Amount in the smallest indivisible unit of a currency. This field is optional for high precision. If provided, it is checked for validity. Example:
A Price of 1.015 USD can be rounded either to 1.01 USD or 1.02 USD. If it lies outside of this range, an error message stating that centAmount must be rounded correctly will be returned.
If
centAmount
is not provided, the API calculates the value automatically using the default rounding mode half even.- Specified by:
getCentAmount
in interfaceHighPrecisionMoneyDraft
- Specified by:
getCentAmount
in interfaceMoney
- Returns:
- centAmount
-
getCurrencyCode
Currency code compliant to ISO 4217.
- Specified by:
getCurrencyCode
in interfaceMoney
- Returns:
- currencyCode
-
getType
- Specified by:
getType
in interfaceTypedMoneyDraft
- Returns:
- type
-
getFractionDigits
Number of fraction digits for a specified high precision money. It must be greater than the default number of fraction digits for the specified currency.
- Specified by:
getFractionDigits
in interfaceHighPrecisionMoneyDraft
- Specified by:
getFractionDigits
in interfaceTypedMoneyDraft
- Returns:
- fractionDigits
-
getPreciseAmount
Amount in 1 / (10 ^
fractionDigits
) of a currency.- Specified by:
getPreciseAmount
in interfaceHighPrecisionMoneyDraft
- Returns:
- preciseAmount
-
setCentAmount
Description copied from interface:HighPrecisionMoneyDraft
Amount in the smallest indivisible unit of a currency. This field is optional for high precision. If provided, it is checked for validity. Example:
A Price of 1.015 USD can be rounded either to 1.01 USD or 1.02 USD. If it lies outside of this range, an error message stating that centAmount must be rounded correctly will be returned.
If
centAmount
is not provided, the API calculates the value automatically using the default rounding mode half even.- Specified by:
setCentAmount
in interfaceHighPrecisionMoneyDraft
- Specified by:
setCentAmount
in interfaceMoney
- Parameters:
centAmount
- value to be set
-
setCurrencyCode
- Specified by:
setCurrencyCode
in interfaceMoney
-
setFractionDigits
Description copied from interface:HighPrecisionMoneyDraft
Number of fraction digits for a specified high precision money. It must be greater than the default number of fraction digits for the specified currency.
- Specified by:
setFractionDigits
in interfaceHighPrecisionMoneyDraft
- Specified by:
setFractionDigits
in interfaceTypedMoneyDraft
- Parameters:
fractionDigits
- value to be set
-
setPreciseAmount
Description copied from interface:HighPrecisionMoneyDraft
Amount in 1 / (10 ^
fractionDigits
) of a currency.- Specified by:
setPreciseAmount
in interfaceHighPrecisionMoneyDraft
- Parameters:
preciseAmount
- value to be set
-
equals
-
hashCode
-