Class TaxPortionDraftBuilder
java.lang.Object
com.commercetools.api.models.cart.TaxPortionDraftBuilder
- All Implemented Interfaces:
Builder<TaxPortionDraft>
TaxPortionDraftBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
TaxPortionDraft taxPortionDraft = TaxPortionDraft.builder()
.rate(0.3)
.amount(amountBuilder -> amountBuilder)
.build()
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionMoney value for the tax portion.amount(Function<MoneyBuilder, MoneyBuilder> builder) Money value for the tax portion.build()builds TaxPortionDraft with checking for non-null required valuesbuilds TaxPortionDraft without checking for non-null required valuesMoney value for the tax portion.getName()Name of the tax portion.getRate()A number in the range 0-1.Name of the tax portion.static TaxPortionDraftBuilderof()factory method for an instance of TaxPortionDraftBuilderstatic TaxPortionDraftBuilderof(TaxPortionDraft template) create builder for TaxPortionDraft instanceA number in the range 0-1.withAmount(Function<MoneyBuilder, Money> builder) Money value for the tax portion.
-
Constructor Details
-
TaxPortionDraftBuilder
public TaxPortionDraftBuilder()
-
-
Method Details
-
name
Name of the tax portion.
- Parameters:
name- value to be set- Returns:
- Builder
-
rate
A number in the range 0-1.
- Parameters:
rate- value to be set- Returns:
- Builder
-
amount
Money value for the tax portion.
- Parameters:
builder- function to build the amount value- Returns:
- Builder
-
withAmount
Money value for the tax portion.
- Parameters:
builder- function to build the amount value- Returns:
- Builder
-
amount
Money value for the tax portion.
- Parameters:
amount- value to be set- Returns:
- Builder
-
getName
Name of the tax portion.
- Returns:
- name
-
getRate
A number in the range 0-1.
- Returns:
- rate
-
getAmount
Money value for the tax portion.
- Returns:
- amount
-
build
builds TaxPortionDraft with checking for non-null required values- Specified by:
buildin interfaceBuilder<TaxPortionDraft>- Returns:
- TaxPortionDraft
-
buildUnchecked
builds TaxPortionDraft without checking for non-null required values- Returns:
- TaxPortionDraft
-
of
factory method for an instance of TaxPortionDraftBuilder- Returns:
- builder
-
of
create builder for TaxPortionDraft instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-