Interface ExternalTaxRateDraft
- All Superinterfaces:
Draft<ExternalTaxRateDraft>
Example to create an instance using the builder pattern
ExternalTaxRateDraft externalTaxRateDraft = ExternalTaxRateDraft.builder()
.name("{name}")
.country("{country}")
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic ExternalTaxRateDraftBuilderbuilder()builder factory method for ExternalTaxRateDraftstatic ExternalTaxRateDraftBuilderbuilder(ExternalTaxRateDraft template) create builder for ExternalTaxRateDraft instancecopyDeep()static ExternalTaxRateDraftdeepCopy(ExternalTaxRateDraft template) factory method to create a deep copy of ExternalTaxRateDraftPercentage in the range of 0-1.@NotNull StringCountry for which the tax applies.If set tofalse, the related price is considered the net price and the providedamountis applied to calculate the gross price. If set totrue, the related price is considered the gross price, and the providedamountis applied to calculate the net price.@NotNull StringgetName()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).static ExternalTaxRateDraftof()factory methodstatic ExternalTaxRateDraftof(ExternalTaxRateDraft template) factory method to create a shallow copy ExternalTaxRateDraftvoidPercentage in the range of 0-1.voidsetCountry(String country) Country for which the tax applies.voidsetIncludedInPrice(Boolean includedInPrice) If set tofalse, the related price is considered the net price and the providedamountis applied to calculate the gross price. If set totrue, the related price is considered the gross price, and the providedamountis applied to calculate the net price.voidName of the Tax Rate.voidState within the specified country.voidsetSubRates(SubRate... subRates) Used when the total tax is a combination of multiple taxes (for example, local, state/provincial, and/or federal taxes).voidsetSubRates(List<SubRate> subRates) Used when the total tax is a combination of multiple taxes (for example, local, state/provincial, and/or federal taxes).static com.fasterxml.jackson.core.type.TypeReference<ExternalTaxRateDraft>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithExternalTaxRateDraft(Function<ExternalTaxRateDraft, T> helper) accessor map function
-
Method Details
-
getName
Name of the Tax Rate.
- Returns:
- name
-
getAmount
Double getAmount()Percentage in the range of 0-1.
- If no
subRatesare specified, a value must be defined. - If
subRatesare specified, this can be omitted or its value must be the sum of allsubRatesamounts.
- Returns:
- amount
- If no
-
getCountry
Country for which the tax applies.
- Returns:
- country
-
getState
String 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 thetaxPortionsfield of a Cart or Order and thetaxedPricefield of LineItems, CustomLineItems, and ShippingInfos.- Returns:
- subRates
-
getIncludedInPrice
Boolean getIncludedInPrice()- If set to
false, the related price is considered the net price and the providedamountis applied to calculate the gross price. - If set to
true, the related price is considered the gross price, and the providedamountis applied to calculate the net price.
- Returns:
- includedInPrice
- If set to
-
setName
Name of the Tax Rate.
- Parameters:
name- value to be set
-
setAmount
Percentage in the range of 0-1.
- If no
subRatesare specified, a value must be defined. - If
subRatesare specified, this can be omitted or its value must be the sum of allsubRatesamounts.
- Parameters:
amount- value to be set
- If no
-
setCountry
Country for which the tax applies.
- Parameters:
country- value to be set
-
setState
State within the specified country.
- Parameters:
state- value to be set
-
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 thetaxPortionsfield of a Cart or Order and thetaxedPricefield of LineItems, CustomLineItems, and ShippingInfos.- Parameters:
subRates- values to be set
-
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 thetaxPortionsfield of a Cart or Order and thetaxedPricefield of LineItems, CustomLineItems, and ShippingInfos.- Parameters:
subRates- values to be set
-
setIncludedInPrice
- If set to
false, the related price is considered the net price and the providedamountis applied to calculate the gross price. - If set to
true, the related price is considered the gross price, and the providedamountis applied to calculate the net price.
- Parameters:
includedInPrice- value to be set
- If set to
-
of
factory method- Returns:
- instance of ExternalTaxRateDraft
-
of
factory method to create a shallow copy ExternalTaxRateDraft- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
ExternalTaxRateDraft copyDeep() -
deepCopy
factory method to create a deep copy of ExternalTaxRateDraft- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for ExternalTaxRateDraft- Returns:
- builder
-
builder
create builder for ExternalTaxRateDraft instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withExternalTaxRateDraft
accessor map function- Type Parameters:
T- mapped type- Parameters:
helper- function to map the object- Returns:
- mapped value
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-