Class TaxedPriceBuilder

java.lang.Object
com.commercetools.importapi.models.orders.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

      Maps to TaxedPrice.totalNet.

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

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

      Maps to TaxedPrice.totalNet.

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

      public TaxedPriceBuilder totalNet(Money totalNet)

      Maps to TaxedPrice.totalNet.

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

      public TaxedPriceBuilder totalGross(Function<MoneyBuilder,MoneyBuilder> builder)

      Maps to TaxedPrice.totalGross.

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

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

      Maps to TaxedPrice.totalGross.

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

      public TaxedPriceBuilder totalGross(Money totalGross)

      Maps to TaxedPrice.totalGross.

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

      public TaxedPriceBuilder taxPortions(TaxPortion... taxPortions)

      Maps to TaxedPrice.taxPortions.

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

      public TaxedPriceBuilder taxPortions(List<TaxPortion> taxPortions)

      Maps to TaxedPrice.taxPortions.

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

      public TaxedPriceBuilder plusTaxPortions(TaxPortion... taxPortions)

      Maps to TaxedPrice.taxPortions.

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

      Maps to TaxedPrice.taxPortions.

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

      Maps to TaxedPrice.taxPortions.

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

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

      Maps to TaxedPrice.taxPortions.

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

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

      Maps to TaxedPrice.taxPortions.

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

      public Money getTotalNet()

      Maps to TaxedPrice.totalNet.

      Returns:
      totalNet
    • getTotalGross

      public Money getTotalGross()

      Maps to TaxedPrice.totalGross.

      Returns:
      totalGross
    • getTaxPortions

      public List<TaxPortion> getTaxPortions()

      Maps to TaxedPrice.taxPortions.

      Returns:
      taxPortions
    • 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