Class TaxedPriceBuilder
- All Implemented Interfaces:
Builder<TaxedPrice>
Example to create an instance using the builder pattern
TaxedPrice taxedPrice = TaxedPrice.builder()
.totalNet(totalNetBuilder -> totalNetBuilder)
.totalGross(totalGrossBuilder -> totalGrossBuilder)
.plusTaxPortions(taxPortionsBuilder -> taxPortionsBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddTaxPortions
(Function<TaxPortionBuilder, TaxPortion> builder) Taxable portions added to the total net price.build()
builds TaxedPrice with checking for non-null required valuesbuilds TaxedPrice without checking for non-null required valuesTaxable portions added to the total net price.Total gross price of the Cart or Order.Total net price of the Cart or Order.Total tax applicable for the Cart or Order.static TaxedPriceBuilder
of()
factory method for an instance of TaxedPriceBuilderstatic TaxedPriceBuilder
of
(TaxedPrice template) create builder for TaxedPrice instanceplusTaxPortions
(TaxPortion... taxPortions) Taxable portions added to the total net price.Taxable portions added to the total net price.setTaxPortions
(Function<TaxPortionBuilder, TaxPortion> builder) Taxable portions added to the total net price.taxPortions
(TaxPortion... taxPortions) Taxable portions added to the total net price.taxPortions
(List<TaxPortion> taxPortions) Taxable portions added to the total net price.totalGross
(CentPrecisionMoney totalGross) Total gross price of the Cart or Order.Total gross price of the Cart or Order.totalNet
(CentPrecisionMoney totalNet) Total net price of the Cart or Order.Total net price of the Cart or Order.totalTax
(CentPrecisionMoney totalTax) Total tax applicable for the Cart or Order.Total tax applicable for the Cart or Order.Taxable portions added to the total net price.Total gross price of the Cart or Order.Total net price of the Cart or Order.Total tax applicable for the Cart or Order.
-
Constructor Details
-
TaxedPriceBuilder
public TaxedPriceBuilder()
-
-
Method Details
-
totalNet
public TaxedPriceBuilder totalNet(Function<CentPrecisionMoneyBuilder, CentPrecisionMoneyBuilder> builder) Total net price of the Cart or Order.
- Parameters:
builder
- function to build the totalNet value- Returns:
- Builder
-
withTotalNet
public TaxedPriceBuilder withTotalNet(Function<CentPrecisionMoneyBuilder, CentPrecisionMoney> builder) Total net price of the Cart or Order.
- Parameters:
builder
- function to build the totalNet value- Returns:
- Builder
-
totalNet
Total net price of the Cart or Order.
- Parameters:
totalNet
- value to be set- Returns:
- Builder
-
totalGross
public TaxedPriceBuilder totalGross(Function<CentPrecisionMoneyBuilder, CentPrecisionMoneyBuilder> builder) Total gross price of the Cart or Order.
- Parameters:
builder
- function to build the totalGross value- Returns:
- Builder
-
withTotalGross
public TaxedPriceBuilder withTotalGross(Function<CentPrecisionMoneyBuilder, CentPrecisionMoney> builder) Total gross price of the Cart or Order.
- Parameters:
builder
- function to build the totalGross value- Returns:
- Builder
-
totalGross
Total gross price of the Cart or Order.
- Parameters:
totalGross
- value to be set- Returns:
- Builder
-
taxPortions
Taxable portions added to the total net price.
Calculated from the TaxRates.
- Parameters:
taxPortions
- value to be set- Returns:
- Builder
-
taxPortions
Taxable portions added to the total net price.
Calculated from the TaxRates.
- Parameters:
taxPortions
- value to be set- Returns:
- Builder
-
plusTaxPortions
Taxable portions added to the total net price.
Calculated from the TaxRates.
- Parameters:
taxPortions
- value to be set- Returns:
- Builder
-
plusTaxPortions
Taxable portions added to the total net price.
Calculated from the TaxRates.
- Parameters:
builder
- function to build the taxPortions value- Returns:
- Builder
-
withTaxPortions
Taxable portions added to the total net price.
Calculated from the TaxRates.
- Parameters:
builder
- function to build the taxPortions value- Returns:
- Builder
-
addTaxPortions
Taxable portions added to the total net price.
Calculated from the TaxRates.
- Parameters:
builder
- function to build the taxPortions value- Returns:
- Builder
-
setTaxPortions
Taxable portions added to the total net price.
Calculated from the TaxRates.
- Parameters:
builder
- function to build the taxPortions value- Returns:
- Builder
-
totalTax
public TaxedPriceBuilder totalTax(Function<CentPrecisionMoneyBuilder, CentPrecisionMoneyBuilder> builder) Total tax applicable for the Cart or Order.
Automatically calculated as the difference between the
totalGross
andtotalNet
values.- Parameters:
builder
- function to build the totalTax value- Returns:
- Builder
-
withTotalTax
public TaxedPriceBuilder withTotalTax(Function<CentPrecisionMoneyBuilder, CentPrecisionMoney> builder) Total tax applicable for the Cart or Order.
Automatically calculated as the difference between the
totalGross
andtotalNet
values.- Parameters:
builder
- function to build the totalTax value- Returns:
- Builder
-
totalTax
Total tax applicable for the Cart or Order.
Automatically calculated as the difference between the
totalGross
andtotalNet
values.- Parameters:
totalTax
- value to be set- Returns:
- Builder
-
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
totalGross
andtotalNet
values.- Returns:
- totalTax
-
build
builds TaxedPrice with checking for non-null required values- Specified by:
build
in interfaceBuilder<TaxedPrice>
- Returns:
- TaxedPrice
-
buildUnchecked
builds TaxedPrice without checking for non-null required values- Returns:
- TaxedPrice
-
of
factory method for an instance of TaxedPriceBuilder- Returns:
- builder
-
of
create builder for TaxedPrice instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-