Interface CentPrecisionMoney
- All Superinterfaces:
Money,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
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic CentPrecisionMoneyBuilderbuilder()builder factory method for CentPrecisionMoneystatic CentPrecisionMoneyBuilderbuilder(CentPrecisionMoney template) create builder for CentPrecisionMoney instancecopyDeep()static CentPrecisionMoneydeepCopy(CentPrecisionMoney template) factory method to create a deep copy of CentPrecisionMoney@NotNull IntegerThe number of default fraction digits for the given currency, like2for EUR or0for JPY.static CentPrecisionMoneyof()factory methodstatic CentPrecisionMoneyof(CentPrecisionMoney template) factory method to create a shallow copy CentPrecisionMoneyvoidsetFractionDigits(Integer fractionDigits) The number of default fraction digits for the given currency, like2for EUR or0for JPY.static com.fasterxml.jackson.core.type.TypeReference<CentPrecisionMoney>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithCentPrecisionMoney(Function<CentPrecisionMoney, T> helper) accessor map functionMethods inherited from interface com.commercetools.history.models.common.Money
getCentAmount, getCurrencyCode, setCentAmount, setCurrencyCode, withMoneyMethods inherited from interface com.commercetools.history.models.common.TypedMoney
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
2for EUR or0for JPY.- Specified by:
getFractionDigitsin interfaceTypedMoney- Returns:
- fractionDigits
-
setFractionDigits
The number of default fraction digits for the given currency, like
2for EUR or0for JPY.- Specified by:
setFractionDigitsin 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
-
copyDeep
CentPrecisionMoney copyDeep()- Specified by:
copyDeepin interfaceMoney- Specified by:
copyDeepin interfaceTypedMoney
-
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
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-