Class TaxedPriceBuilder

java.lang.Object
com.commercetools.api.models.cart.TaxedPriceBuilder
All Implemented Interfaces:
Builder<TaxedPrice>

public class TaxedPriceBuilder extends Object implements Builder<TaxedPrice>
TaxedPriceBuilder
Example to create an instance using the builder pattern

     TaxedPrice taxedPrice = TaxedPrice.builder()
             .totalNet(totalNetBuilder -> totalNetBuilder)
             .totalGross(totalGrossBuilder -> totalGrossBuilder)
             .plusTaxPortions(taxPortionsBuilder -> taxPortionsBuilder)
             .build()
 
  • Constructor Details

    • TaxedPriceBuilder

      public TaxedPriceBuilder()
  • Method Details

    • totalNet

      Total net price of the Cart or Order.

      Parameters:
      builder - function to build the totalNet value
      Returns:
      Builder
    • withTotalNet

      Total net price of the Cart or Order.

      Parameters:
      builder - function to build the totalNet value
      Returns:
      Builder
    • totalNet

      public TaxedPriceBuilder totalNet(CentPrecisionMoney totalNet)

      Total net price of the Cart or Order.

      Parameters:
      totalNet - value to be set
      Returns:
      Builder
    • totalGross

      Total gross price of the Cart or Order.

      Parameters:
      builder - function to build the totalGross value
      Returns:
      Builder
    • withTotalGross

      Total gross price of the Cart or Order.

      Parameters:
      builder - function to build the totalGross value
      Returns:
      Builder
    • totalGross

      public TaxedPriceBuilder totalGross(CentPrecisionMoney totalGross)

      Total gross price of the Cart or Order.

      Parameters:
      totalGross - value to be set
      Returns:
      Builder
    • taxPortions

      public TaxedPriceBuilder taxPortions(TaxPortion... taxPortions)

      Taxable portions added to the total net price.

      Calculated from the TaxRates.

      Parameters:
      taxPortions - value to be set
      Returns:
      Builder
    • taxPortions

      public TaxedPriceBuilder taxPortions(List<TaxPortion> taxPortions)

      Taxable portions added to the total net price.

      Calculated from the TaxRates.

      Parameters:
      taxPortions - value to be set
      Returns:
      Builder
    • plusTaxPortions

      public TaxedPriceBuilder plusTaxPortions(TaxPortion... 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:
      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

      public TaxedPriceBuilder addTaxPortions(Function<TaxPortionBuilder,TaxPortion> builder)

      Taxable portions added to the total net price.

      Calculated from the TaxRates.

      Parameters:
      builder - function to build the taxPortions value
      Returns:
      Builder
    • setTaxPortions

      public TaxedPriceBuilder setTaxPortions(Function<TaxPortionBuilder,TaxPortion> builder)

      Taxable portions added to the total net price.

      Calculated from the TaxRates.

      Parameters:
      builder - function to build the taxPortions value
      Returns:
      Builder
    • totalTax

      Total tax applicable for the Cart or Order.

      Automatically calculated as the difference between the totalGross and totalNet values.

      Parameters:
      builder - function to build the totalTax value
      Returns:
      Builder
    • withTotalTax

      Total tax applicable for the Cart or Order.

      Automatically calculated as the difference between the totalGross and totalNet values.

      Parameters:
      builder - function to build the totalTax value
      Returns:
      Builder
    • totalTax

      public TaxedPriceBuilder totalTax(@Nullable CentPrecisionMoney totalTax)

      Total tax applicable for the Cart or Order.

      Automatically calculated as the difference between the totalGross and totalNet values.

      Parameters:
      totalTax - value to be set
      Returns:
      Builder
    • getTotalNet

      public CentPrecisionMoney getTotalNet()

      Total net price of the Cart or Order.

      Returns:
      totalNet
    • getTotalGross

      public CentPrecisionMoney getTotalGross()

      Total gross price of the Cart or Order.

      Returns:
      totalGross
    • getTaxPortions

      public List<TaxPortion> getTaxPortions()

      Taxable portions added to the total net price.

      Calculated from the TaxRates.

      Returns:
      taxPortions
    • getTotalTax

      @Nullable public CentPrecisionMoney getTotalTax()

      Total tax applicable for the Cart or Order.

      Automatically calculated as the difference between the totalGross and totalNet values.

      Returns:
      totalTax
    • build

      public TaxedPrice build()
      builds TaxedPrice with checking for non-null required values
      Specified by:
      build in interface Builder<TaxedPrice>
      Returns:
      TaxedPrice
    • buildUnchecked

      public TaxedPrice buildUnchecked()
      builds TaxedPrice without checking for non-null required values
      Returns:
      TaxedPrice
    • of

      public static TaxedPriceBuilder of()
      factory method for an instance of TaxedPriceBuilder
      Returns:
      builder
    • of

      public static TaxedPriceBuilder of(TaxedPrice template)
      create builder for TaxedPrice instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder