Class TaxRateBuilder
java.lang.Object
com.commercetools.importapi.models.prices.TaxRateBuilder
TaxRateBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
TaxRate taxRate = TaxRate.builder()
.name("{name}")
.amount(0.3)
.includedInPrice(true)
.country("{country}")
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddSubRates
(Function<SubRateBuilder, SubRate> builder) add the value to the subRates using the builder functionset the value to the amountbuild()
builds TaxRate with checking for non-null required valuesbuilds TaxRate without checking for non-null required valuesA two-digit country code as per ISO 3166-1 alpha-2.value of amount}A two-digit country code as per ISO 3166-1 alpha-2.getId()
value of id}value of includedInPrice}getName()
value of name}getState()
value of state}value of subRates}set the value to the idincludedInPrice
(Boolean includedInPrice) set the value to the includedInPriceset the value to the namestatic TaxRateBuilder
of()
factory method for an instance of TaxRateBuilderstatic TaxRateBuilder
create builder for TaxRate instanceplusSubRates
(SubRate... subRates) add values to the subRatesplusSubRates
(Function<SubRateBuilder, SubRateBuilder> builder) add the value to the subRates using the builder functionsetSubRates
(Function<SubRateBuilder, SubRate> builder) set the value to the subRates using the builder functionset the value to the stateset values to the subRatesset value to the subRateswithSubRates
(Function<SubRateBuilder, SubRateBuilder> builder) set the value to the subRates using the builder function
-
Constructor Details
-
TaxRateBuilder
public TaxRateBuilder()
-
-
Method Details
-
id
set the value to the id- Parameters:
id
- value to be set- Returns:
- Builder
-
name
set the value to the name- Parameters:
name
- value to be set- Returns:
- Builder
-
amount
set the value to the amount- Parameters:
amount
- value to be set- Returns:
- Builder
-
includedInPrice
set the value to the includedInPrice- Parameters:
includedInPrice
- value to be set- Returns:
- Builder
-
country
A two-digit country code as per ISO 3166-1 alpha-2.
- Parameters:
country
- value to be set- Returns:
- Builder
-
state
set the value to the state- Parameters:
state
- value to be set- Returns:
- Builder
-
subRates
set values to the subRates- Parameters:
subRates
- value to be set- Returns:
- Builder
-
subRates
set value to the subRates- Parameters:
subRates
- value to be set- Returns:
- Builder
-
plusSubRates
add values to the subRates- Parameters:
subRates
- value to be set- Returns:
- Builder
-
plusSubRates
add the value to the subRates using the builder function- Parameters:
builder
- function to build the subRates value- Returns:
- Builder
-
withSubRates
set the value to the subRates using the builder function- Parameters:
builder
- function to build the subRates value- Returns:
- Builder
-
addSubRates
add the value to the subRates using the builder function- Parameters:
builder
- function to build the subRates value- Returns:
- Builder
-
setSubRates
set the value to the subRates using the builder function- Parameters:
builder
- function to build the subRates value- Returns:
- Builder
-
getId
value of id}- Returns:
- id
-
getName
value of name}- Returns:
- name
-
getAmount
value of amount}- Returns:
- amount
-
getIncludedInPrice
value of includedInPrice}- Returns:
- includedInPrice
-
getCountry
A two-digit country code as per ISO 3166-1 alpha-2.
- Returns:
- country
-
getState
value of state}- Returns:
- state
-
getSubRates
value of subRates}- Returns:
- subRates
-
build
builds TaxRate with checking for non-null required values -
buildUnchecked
builds TaxRate without checking for non-null required values- Returns:
- TaxRate
-
of
factory method for an instance of TaxRateBuilder- Returns:
- builder
-
of
create builder for TaxRate instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-