Class TaxedItemPriceBuilder

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

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

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

    • TaxedItemPriceBuilder

      public TaxedItemPriceBuilder()
  • Method Details

    • totalNet

      Total net amount of the Line Item or Custom Line Item.

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

      Total net amount of the Line Item or Custom Line Item.

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

      public TaxedItemPriceBuilder totalNet(CentPrecisionMoney totalNet)

      Total net amount of the Line Item or Custom Line Item.

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

      Total gross amount of the Line Item or Custom Line Item.

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

      Total gross amount of the Line Item or Custom Line Item.

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

      public TaxedItemPriceBuilder totalGross(CentPrecisionMoney totalGross)

      Total gross amount of the Line Item or Custom Line Item.

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

      public TaxedItemPriceBuilder 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 TaxedItemPriceBuilder 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 TaxedItemPriceBuilder 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 TaxedItemPriceBuilder 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 TaxedItemPriceBuilder 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 Line Item or Custom Line Item. 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 Line Item or Custom Line Item. Automatically calculated as the difference between the totalGross and totalNet values.

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

      public TaxedItemPriceBuilder totalTax(@Nullable CentPrecisionMoney totalTax)

      Total tax applicable for the Line Item or Custom Line Item. 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 amount of the Line Item or Custom Line Item.

      Returns:
      totalNet
    • getTotalGross

      public CentPrecisionMoney getTotalGross()

      Total gross amount of the Line Item or Custom Line Item.

      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 Line Item or Custom Line Item. Automatically calculated as the difference between the totalGross and totalNet values.

      Returns:
      totalTax
    • build

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

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

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

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