Interface TaxPortionDraft
- All Superinterfaces:
Draft<TaxPortionDraft>
Represents the portions that sum up to the totalGross field of a TaxedPrice.
The portions are calculated from the TaxRates. If a Tax Rate has SubRates, they are used and can be identified by name. Tax portions from Line Items with the same rate and name will be accumulated to the same tax portion.
Example to create an instance using the builder pattern
TaxPortionDraft taxPortionDraft = TaxPortionDraft.builder()
.rate(0.3)
.amount(amountBuilder -> amountBuilder)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic TaxPortionDraftBuilderbuilder()builder factory method for TaxPortionDraftstatic TaxPortionDraftBuilderbuilder(TaxPortionDraft template) create builder for TaxPortionDraft instancecopyDeep()static TaxPortionDraftdeepCopy(TaxPortionDraft template) factory method to create a deep copy of TaxPortionDraft@NotNull @Valid MoneyMoney value for the tax portion.getName()Name of the tax portion.@NotNull DoublegetRate()A number in the range 0-1.static TaxPortionDraftof()factory methodstatic TaxPortionDraftof(TaxPortionDraft template) factory method to create a shallow copy TaxPortionDraftvoidMoney value for the tax portion.voidName of the tax portion.voidA number in the range 0-1.static com.fasterxml.jackson.core.type.TypeReference<TaxPortionDraft>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithTaxPortionDraft(Function<TaxPortionDraft, T> helper) accessor map function
-
Method Details
-
getName
String 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
-
setName
Name of the tax portion.
- Parameters:
name- value to be set
-
setRate
A number in the range 0-1.
- Parameters:
rate- value to be set
-
setAmount
Money value for the tax portion.
- Parameters:
amount- value to be set
-
of
factory method- Returns:
- instance of TaxPortionDraft
-
of
factory method to create a shallow copy TaxPortionDraft- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
TaxPortionDraft copyDeep() -
deepCopy
factory method to create a deep copy of TaxPortionDraft- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for TaxPortionDraft- Returns:
- builder
-
builder
create builder for TaxPortionDraft instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withTaxPortionDraft
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
-