Interface TaxedPrice
public interface TaxedPrice
TaxedPrice
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
TaxedPrice taxedPrice = TaxedPrice.builder()
.totalNet(totalNetBuilder -> totalNetBuilder)
.totalGross(totalGrossBuilder -> totalGrossBuilder)
.plusTaxPortions(taxPortionsBuilder -> taxPortionsBuilder)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic TaxedPriceBuilderbuilder()builder factory method for TaxedPricestatic TaxedPriceBuilderbuilder(TaxedPrice template) create builder for TaxedPrice instancecopyDeep()static TaxedPricedeepCopy(TaxedPrice template) factory method to create a deep copy of TaxedPrice@NotNull @Valid List<TaxPortion>Taxable portions added to the total net price.@NotNull @Valid CentPrecisionMoneyTotal gross price of the Cart or Order.@NotNull @Valid CentPrecisionMoneyTotal net price of the Cart or Order.@Valid CentPrecisionMoneyTotal tax applicable for the Cart or Order.static TaxedPriceof()factory methodstatic TaxedPriceof(TaxedPrice template) factory method to create a shallow copy TaxedPricevoidsetTaxPortions(TaxPortion... taxPortions) Taxable portions added to the total net price.voidsetTaxPortions(List<TaxPortion> taxPortions) Taxable portions added to the total net price.voidsetTotalGross(CentPrecisionMoney totalGross) Total gross price of the Cart or Order.voidsetTotalNet(CentPrecisionMoney totalNet) Total net price of the Cart or Order.voidsetTotalTax(CentPrecisionMoney totalTax) Total tax applicable for the Cart or Order.static com.fasterxml.jackson.core.type.TypeReference<TaxedPrice>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithTaxedPrice(Function<TaxedPrice, T> helper) accessor map function
-
Method Details
-
getTotalNet
Total net price of the Cart or Order.
- Returns:
- totalNet
-
getTotalGross
Total gross price of the Cart or Order.
- Returns:
- totalGross
-
getTaxPortions
Taxable portions added to the total net price.
Calculated from the TaxRates.
- Returns:
- taxPortions
-
getTotalTax
Total tax applicable for the Cart or Order.
Automatically calculated as the difference between the
totalGrossandtotalNetvalues.- Returns:
- totalTax
-
setTotalNet
Total net price of the Cart or Order.
- Parameters:
totalNet- value to be set
-
setTotalGross
Total gross price of the Cart or Order.
- Parameters:
totalGross- value to be set
-
setTaxPortions
Taxable portions added to the total net price.
Calculated from the TaxRates.
- Parameters:
taxPortions- values to be set
-
setTaxPortions
Taxable portions added to the total net price.
Calculated from the TaxRates.
- Parameters:
taxPortions- values to be set
-
setTotalTax
Total tax applicable for the Cart or Order.
Automatically calculated as the difference between the
totalGrossandtotalNetvalues.- Parameters:
totalTax- value to be set
-
of
factory method- Returns:
- instance of TaxedPrice
-
of
factory method to create a shallow copy TaxedPrice- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
TaxedPrice copyDeep() -
deepCopy
factory method to create a deep copy of TaxedPrice- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for TaxedPrice- Returns:
- builder
-
builder
create builder for TaxedPrice instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withTaxedPrice
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
-