Class ExternalTaxRateDraftBuilder
- All Implemented Interfaces:
Builder<ExternalTaxRateDraft>
Example to create an instance using the builder pattern
ExternalTaxRateDraft externalTaxRateDraft = ExternalTaxRateDraft.builder()
.name("{name}")
.country("{country}")
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddSubRates
(Function<SubRateBuilder, SubRate> builder) Used when the total tax is a combination of multiple taxes (for example, local, state/provincial, and/or federal taxes).Percentage in the range of 0-1.build()
builds ExternalTaxRateDraft with checking for non-null required valuesbuilds ExternalTaxRateDraft without checking for non-null required valuesCountry for which the tax applies.Percentage in the range of 0-1.Country for which the tax applies.If set tofalse
, the related price is considered the net price and the providedamount
is applied to calculate the gross price. If set totrue
, the related price is considered the gross price, and the providedamount
is applied to calculate the net price.getName()
Name of the Tax Rate.getState()
State within the specified country.Used when the total tax is a combination of multiple taxes (for example, local, state/provincial, and/or federal taxes).includedInPrice
(Boolean includedInPrice) If set tofalse
, the related price is considered the net price and the providedamount
is applied to calculate the gross price. If set totrue
, the related price is considered the gross price, and the providedamount
is applied to calculate the net price.Name of the Tax Rate.static ExternalTaxRateDraftBuilder
of()
factory method for an instance of ExternalTaxRateDraftBuilderstatic ExternalTaxRateDraftBuilder
of
(ExternalTaxRateDraft template) create builder for ExternalTaxRateDraft instanceplusSubRates
(SubRate... subRates) Used when the total tax is a combination of multiple taxes (for example, local, state/provincial, and/or federal taxes).plusSubRates
(Function<SubRateBuilder, SubRateBuilder> builder) Used when the total tax is a combination of multiple taxes (for example, local, state/provincial, and/or federal taxes).setSubRates
(Function<SubRateBuilder, SubRate> builder) Used when the total tax is a combination of multiple taxes (for example, local, state/provincial, and/or federal taxes).State within the specified country.Used when the total tax is a combination of multiple taxes (for example, local, state/provincial, and/or federal taxes).Used when the total tax is a combination of multiple taxes (for example, local, state/provincial, and/or federal taxes).withSubRates
(Function<SubRateBuilder, SubRateBuilder> builder) Used when the total tax is a combination of multiple taxes (for example, local, state/provincial, and/or federal taxes).
-
Constructor Details
-
ExternalTaxRateDraftBuilder
public ExternalTaxRateDraftBuilder()
-
-
Method Details
-
name
Name of the Tax Rate.
- Parameters:
name
- value to be set- Returns:
- Builder
-
amount
Percentage in the range of 0-1.
- If no
subRates
are specified, a value must be defined. - If
subRates
are specified, this can be omitted or its value must be the sum of allsubRates
amounts.
- Parameters:
amount
- value to be set- Returns:
- Builder
- If no
-
includedInPrice
- If set to
false
, the related price is considered the net price and the providedamount
is applied to calculate the gross price. - If set to
true
, the related price is considered the gross price, and the providedamount
is applied to calculate the net price.
- Parameters:
includedInPrice
- value to be set- Returns:
- Builder
- If set to
-
country
Country for which the tax applies.
- Parameters:
country
- value to be set- Returns:
- Builder
-
state
State within the specified country.
- Parameters:
state
- value to be set- Returns:
- Builder
-
subRates
Used when the total tax is a combination of multiple taxes (for example, local, state/provincial, and/or federal taxes). The total of all subrates must equal the TaxRate
amount
. These subrates are used to calculate thetaxPortions
field of a Cart or Order and thetaxedPrice
field of LineItems, CustomLineItems, and ShippingInfos.- Parameters:
subRates
- value to be set- Returns:
- Builder
-
subRates
Used when the total tax is a combination of multiple taxes (for example, local, state/provincial, and/or federal taxes). The total of all subrates must equal the TaxRate
amount
. These subrates are used to calculate thetaxPortions
field of a Cart or Order and thetaxedPrice
field of LineItems, CustomLineItems, and ShippingInfos.- Parameters:
subRates
- value to be set- Returns:
- Builder
-
plusSubRates
Used when the total tax is a combination of multiple taxes (for example, local, state/provincial, and/or federal taxes). The total of all subrates must equal the TaxRate
amount
. These subrates are used to calculate thetaxPortions
field of a Cart or Order and thetaxedPrice
field of LineItems, CustomLineItems, and ShippingInfos.- Parameters:
subRates
- value to be set- Returns:
- Builder
-
plusSubRates
Used when the total tax is a combination of multiple taxes (for example, local, state/provincial, and/or federal taxes). The total of all subrates must equal the TaxRate
amount
. These subrates are used to calculate thetaxPortions
field of a Cart or Order and thetaxedPrice
field of LineItems, CustomLineItems, and ShippingInfos.- Parameters:
builder
- function to build the subRates value- Returns:
- Builder
-
withSubRates
Used when the total tax is a combination of multiple taxes (for example, local, state/provincial, and/or federal taxes). The total of all subrates must equal the TaxRate
amount
. These subrates are used to calculate thetaxPortions
field of a Cart or Order and thetaxedPrice
field of LineItems, CustomLineItems, and ShippingInfos.- Parameters:
builder
- function to build the subRates value- Returns:
- Builder
-
addSubRates
Used when the total tax is a combination of multiple taxes (for example, local, state/provincial, and/or federal taxes). The total of all subrates must equal the TaxRate
amount
. These subrates are used to calculate thetaxPortions
field of a Cart or Order and thetaxedPrice
field of LineItems, CustomLineItems, and ShippingInfos.- Parameters:
builder
- function to build the subRates value- Returns:
- Builder
-
setSubRates
Used when the total tax is a combination of multiple taxes (for example, local, state/provincial, and/or federal taxes). The total of all subrates must equal the TaxRate
amount
. These subrates are used to calculate thetaxPortions
field of a Cart or Order and thetaxedPrice
field of LineItems, CustomLineItems, and ShippingInfos.- Parameters:
builder
- function to build the subRates value- Returns:
- Builder
-
getName
Name of the Tax Rate.
- Returns:
- name
-
getAmount
Percentage in the range of 0-1.
- If no
subRates
are specified, a value must be defined. - If
subRates
are specified, this can be omitted or its value must be the sum of allsubRates
amounts.
- Returns:
- amount
- If no
-
getIncludedInPrice
- If set to
false
, the related price is considered the net price and the providedamount
is applied to calculate the gross price. - If set to
true
, the related price is considered the gross price, and the providedamount
is applied to calculate the net price.
- Returns:
- includedInPrice
- If set to
-
getCountry
Country for which the tax applies.
- Returns:
- country
-
getState
State within the specified country.
- Returns:
- state
-
getSubRates
Used when the total tax is a combination of multiple taxes (for example, local, state/provincial, and/or federal taxes). The total of all subrates must equal the TaxRate
amount
. These subrates are used to calculate thetaxPortions
field of a Cart or Order and thetaxedPrice
field of LineItems, CustomLineItems, and ShippingInfos.- Returns:
- subRates
-
build
builds ExternalTaxRateDraft with checking for non-null required values- Specified by:
build
in interfaceBuilder<ExternalTaxRateDraft>
- Returns:
- ExternalTaxRateDraft
-
buildUnchecked
builds ExternalTaxRateDraft without checking for non-null required values- Returns:
- ExternalTaxRateDraft
-
of
factory method for an instance of ExternalTaxRateDraftBuilder- Returns:
- builder
-
of
create builder for ExternalTaxRateDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-