Class CentPrecisionMoneyBuilder
java.lang.Object
com.commercetools.api.models.common.CentPrecisionMoneyBuilder
- All Implemented Interfaces:
Builder<CentPrecisionMoney>
CentPrecisionMoneyBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
CentPrecisionMoney centPrecisionMoney = CentPrecisionMoney.builder()
.centAmount(0.3)
.currencyCode("{currencyCode}")
.fractionDigits(0.3)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds CentPrecisionMoney with checking for non-null required valuesbuilds CentPrecisionMoney without checking for non-null required valuescentAmount
(Long centAmount) Amount in the smallest indivisible unit of a currency, such as:currencyCode
(String currencyCode) Currency code compliant to ISO 4217.fractionDigits
(Integer fractionDigits) The number of default fraction digits for the given currency, like2
for EUR or0
for JPY.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.static CentPrecisionMoneyBuilder
of()
factory method for an instance of CentPrecisionMoneyBuilderstatic CentPrecisionMoneyBuilder
of
(CentPrecisionMoney template) create builder for CentPrecisionMoney instance
-
Constructor Details
-
CentPrecisionMoneyBuilder
public CentPrecisionMoneyBuilder()
-
-
Method Details
-
centAmount
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
).
- Parameters:
centAmount
- value to be set- Returns:
- Builder
- Cents for EUR and USD, pence for GBP, or centime for CHF (5 CHF is specified as
-
currencyCode
Currency code compliant to ISO 4217.
- Parameters:
currencyCode
- value to be set- Returns:
- Builder
-
fractionDigits
The number of default fraction digits for the given currency, like
2
for EUR or0
for JPY.- Parameters:
fractionDigits
- value to be set- Returns:
- Builder
-
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
).
- 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.
- Returns:
- currencyCode
-
getFractionDigits
The number of default fraction digits for the given currency, like
2
for EUR or0
for JPY.- Returns:
- fractionDigits
-
build
builds CentPrecisionMoney with checking for non-null required values- Specified by:
build
in interfaceBuilder<CentPrecisionMoney>
- Returns:
- CentPrecisionMoney
-
buildUnchecked
builds CentPrecisionMoney without checking for non-null required values- Returns:
- CentPrecisionMoney
-
of
factory method for an instance of CentPrecisionMoneyBuilder- Returns:
- builder
-
of
create builder for CentPrecisionMoney instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-