Class MoneyBuilder
java.lang.Object
com.commercetools.importapi.models.common.MoneyBuilder
MoneyBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
Money money = Money.builder()
.centAmount(0.3)
.currencyCode("{currencyCode}")
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds Money with checking for non-null required valuesbuilds Money without checking for non-null required valuescentAmount
(Long centAmount) set the value to the centAmountcurrencyCode
(String currencyCode) The currency code compliant to ISO 4217.fractionDigits
(Integer fractionDigits) set the value to the fractionDigitsvalue of centAmount}The currency code compliant to ISO 4217.value of fractionDigits}static MoneyBuilder
of()
factory method for an instance of MoneyBuilderstatic MoneyBuilder
create builder for Money instance
-
Constructor Details
-
MoneyBuilder
public MoneyBuilder()
-
-
Method Details
-
fractionDigits
set the value to the fractionDigits- Parameters:
fractionDigits
- value to be set- Returns:
- Builder
-
centAmount
set the value to the centAmount- Parameters:
centAmount
- value to be set- Returns:
- Builder
-
currencyCode
The currency code compliant to ISO 4217.
- Parameters:
currencyCode
- value to be set- Returns:
- Builder
-
getFractionDigits
value of fractionDigits}- Returns:
- fractionDigits
-
getCentAmount
value of centAmount}- Returns:
- centAmount
-
getCurrencyCode
The currency code compliant to ISO 4217.
- Returns:
- currencyCode
-
build
builds Money with checking for non-null required values -
buildUnchecked
builds Money without checking for non-null required values- Returns:
- Money
-
of
factory method for an instance of MoneyBuilder- Returns:
- builder
-
of
create builder for Money instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-