Interface TaxRateDraft
- All Superinterfaces:
Draft<TaxRateDraft>
Example to create an instance using the builder pattern
TaxRateDraft taxRateDraft = TaxRateDraft.builder()
.name("{name}")
.includedInPrice(true)
.country("{country}")
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic TaxRateDraftBuilder
builder()
builder factory method for TaxRateDraftstatic TaxRateDraftBuilder
builder
(TaxRateDraft template) create builder for TaxRateDraft instancestatic TaxRateDraft
deepCopy
(TaxRateDraft template) factory method to create a deep copy of TaxRateDraftTax rate.@NotNull String
Country in which the tax rate is applied in ISO 3166-1 alpha-2 format.@NotNull Boolean
Iftrue
, tax is included in Embedded Prices or Standalone Prices, and thetaxedPrice
is present on LineItems.getKey()
User-defined unique identifier of the TaxRate.@NotNull String
getName()
Name of the TaxRate.getState()
State within the country, such as Texas in the United States.Used when the total tax is a combination of multiple taxes (for example, local, state/provincial, and/or federal taxes).static TaxRateDraft
of()
factory methodstatic TaxRateDraft
of
(TaxRateDraft template) factory method to create a shallow copy TaxRateDraftvoid
Tax rate.void
setCountry
(String country) Country in which the tax rate is applied in ISO 3166-1 alpha-2 format.void
setIncludedInPrice
(Boolean includedInPrice) Iftrue
, tax is included in Embedded Prices or Standalone Prices, and thetaxedPrice
is present on LineItems.void
User-defined unique identifier of the TaxRate.void
Name of the TaxRate.void
State within the country, such as Texas in the United States.void
setSubRates
(SubRate... subRates) Used when the total tax is a combination of multiple taxes (for example, local, state/provincial, and/or federal taxes).void
setSubRates
(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<TaxRateDraft>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withTaxRateDraft
(Function<TaxRateDraft, T> helper) accessor map function
-
Method Details
-
getName
Name of the TaxRate.
- Returns:
- name
-
getAmount
Double getAmount()Tax rate. Must be supplied if no
subRates
are specified. IfsubRates
are specified, this field can be omitted or it must be the sum of amounts of allsubRates
.- Returns:
- amount
-
getIncludedInPrice
If
true
, tax is included in Embedded Prices or Standalone Prices, and thetaxedPrice
is present on LineItems. In this case, thetotalNet
price on TaxedPrice includes the TaxRate.- Returns:
- includedInPrice
-
getCountry
Country in which the tax rate is applied in ISO 3166-1 alpha-2 format.
- Returns:
- country
-
getState
String getState()State within the country, such as Texas in the United States.
- 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
-
getKey
String getKey()User-defined unique identifier of the TaxRate.
- Returns:
- key
-
setName
Name of the TaxRate.
- Parameters:
name
- value to be set
-
setAmount
Tax rate. Must be supplied if no
subRates
are specified. IfsubRates
are specified, this field can be omitted or it must be the sum of amounts of allsubRates
.- Parameters:
amount
- value to be set
-
setIncludedInPrice
If
true
, tax is included in Embedded Prices or Standalone Prices, and thetaxedPrice
is present on LineItems. In this case, thetotalNet
price on TaxedPrice includes the TaxRate.- Parameters:
includedInPrice
- value to be set
-
setCountry
Country in which the tax rate is applied in ISO 3166-1 alpha-2 format.
- Parameters:
country
- value to be set
-
setState
State within the country, such as Texas in the United States.
- 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 thetaxPortions
field of a Cart or Order and thetaxedPrice
field 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 thetaxPortions
field of a Cart or Order and thetaxedPrice
field of LineItems, CustomLineItems, and ShippingInfos.- Parameters:
subRates
- values to be set
-
setKey
User-defined unique identifier of the TaxRate.
- Parameters:
key
- value to be set
-
of
factory method- Returns:
- instance of TaxRateDraft
-
of
factory method to create a shallow copy TaxRateDraft- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of TaxRateDraft- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for TaxRateDraft- Returns:
- builder
-
builder
create builder for TaxRateDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withTaxRateDraft
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
-