Class TaxedPriceDraftBuilder

java.lang.Object
com.commercetools.api.models.cart.TaxedPriceDraftBuilder
All Implemented Interfaces:
io.vrap.rmf.base.client.Builder<TaxedPriceDraft>

public class TaxedPriceDraftBuilder extends Object implements io.vrap.rmf.base.client.Builder<TaxedPriceDraft>
TaxedPriceDraftBuilder
Example to create an instance using the builder pattern

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

    • TaxedPriceDraftBuilder

      public TaxedPriceDraftBuilder()
  • Method Details

    • totalNet

      Total net price of the Cart or Order.

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

      public TaxedPriceDraftBuilder withTotalNet(Function<MoneyBuilder,Money> builder)

      Total net price of the Cart or Order.

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

      public TaxedPriceDraftBuilder totalNet(Money 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

      public TaxedPriceDraftBuilder withTotalGross(Function<MoneyBuilder,Money> builder)

      Total gross price of the Cart or Order.

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

      public TaxedPriceDraftBuilder totalGross(Money totalGross)

      Total gross price of the Cart or Order.

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

      public TaxedPriceDraftBuilder taxPortions(TaxPortionDraft... taxPortions)

      Taxable portions added to the totalGross.

      Calculated from the TaxRates.

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

      public TaxedPriceDraftBuilder taxPortions(List<TaxPortionDraft> taxPortions)

      Taxable portions added to the totalGross.

      Calculated from the TaxRates.

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

      public TaxedPriceDraftBuilder plusTaxPortions(TaxPortionDraft... taxPortions)

      Taxable portions added to the totalGross.

      Calculated from the TaxRates.

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

      Taxable portions added to the totalGross.

      Calculated from the TaxRates.

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

      Taxable portions added to the totalGross.

      Calculated from the TaxRates.

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

      Taxable portions added to the totalGross.

      Calculated from the TaxRates.

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

      Taxable portions added to the totalGross.

      Calculated from the TaxRates.

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

      public Money getTotalNet()

      Total net price of the Cart or Order.

      Returns:
      totalNet
    • getTotalGross

      public Money getTotalGross()

      Total gross price of the Cart or Order.

      Returns:
      totalGross
    • getTaxPortions

      public List<TaxPortionDraft> getTaxPortions()

      Taxable portions added to the totalGross.

      Calculated from the TaxRates.

      Returns:
      taxPortions
    • build

      public TaxedPriceDraft build()
      builds TaxedPriceDraft with checking for non-null required values
      Specified by:
      build in interface io.vrap.rmf.base.client.Builder<TaxedPriceDraft>
      Returns:
      TaxedPriceDraft
    • buildUnchecked

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

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

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