Interface CentPrecisionMoney
- All Superinterfaces:
Comparable<javax.money.MonetaryAmount>
,javax.money.CurrencySupplier
,javax.money.MonetaryAmount
,MonetaryAmountConvertable
,Money
,javax.money.NumberSupplier
,TypedMoney
Object that stores money in cent amounts of a specific currency.
Example to create an instance using the builder pattern
CentPrecisionMoney centPrecisionMoney = CentPrecisionMoney.builder()
.centAmount(0.3)
.currencyCode("{currencyCode}")
.fractionDigits(0.3)
.build()
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic CentPrecisionMoneyBuilder
builder()
builder factory method for CentPrecisionMoneystatic CentPrecisionMoneyBuilder
builder
(CentPrecisionMoney template) create builder for CentPrecisionMoney instancestatic CentPrecisionMoney
deepCopy
(CentPrecisionMoney template) factory method to create a deep copy of CentPrecisionMoney@NotNull Integer
The number of default fraction digits for the given currency, like2
for EUR or0
for JPY.static CentPrecisionMoney
of()
factory methodstatic CentPrecisionMoney
of
(CentPrecisionMoney template) factory method to create a shallow copy CentPrecisionMoneystatic CentPrecisionMoney
of
(javax.money.MonetaryAmount monetaryAmount) void
setFractionDigits
(Integer fractionDigits) The number of default fraction digits for the given currency, like2
for EUR or0
for JPY.default CentPrecisionMoneyDraft
toDraft()
static com.fasterxml.jackson.core.type.TypeReference<CentPrecisionMoney>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withCentPrecisionMoney
(Function<CentPrecisionMoney, T> helper) accessor map functionMethods 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, getCentAmount, getContext, getCurrency, getCurrencyCode, getFactory, getNumber, isEqualTo, isGreaterThan, isGreaterThanOrEqualTo, isLessThan, isLessThanOrEqualTo, multiply, multiply, multiply, negate, plus, query, remainder, remainder, remainder, scaleByPowerOfTen, setCentAmount, setCurrencyCode, signum, stripTrailingZeros, subtract, with, withMoney
Methods inherited from interface com.commercetools.api.models.common.TypedMoney
createMoneyOperator, getType, withTypedMoney
-
Field Details
-
CENT_PRECISION
discriminator value for CentPrecisionMoney- See Also:
-
-
Method Details
-
getFractionDigits
The number of default fraction digits for the given currency, like
2
for EUR or0
for JPY.- Specified by:
getFractionDigits
in interfaceTypedMoney
- Returns:
- fractionDigits
-
setFractionDigits
The number of default fraction digits for the given currency, like
2
for EUR or0
for JPY.- Specified by:
setFractionDigits
in interfaceTypedMoney
- Parameters:
fractionDigits
- value to be set
-
of
factory method- Returns:
- instance of CentPrecisionMoney
-
of
factory method to create a shallow copy CentPrecisionMoney- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of CentPrecisionMoney- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for CentPrecisionMoney- Returns:
- builder
-
builder
create builder for CentPrecisionMoney instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withCentPrecisionMoney
accessor map function- Type Parameters:
T
- mapped type- Parameters:
helper
- function to map the object- Returns:
- mapped value
-
of
-
toDraft
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-