Class TaxedPriceBuilder

java.lang.Object
com.commercetools.history.models.common.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)
             .build()
 
  • Constructor Details

    • TaxedPriceBuilder

      public TaxedPriceBuilder()
  • Method Details

    • totalNet

      Total net price of the Order.

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

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

      Total net price of the Order.

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

      public TaxedPriceBuilder totalNet(Money totalNet)

      Total net price of the Order.

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

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

      Total gross price of the Order.

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

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

      Total gross price of the Order.

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

      public TaxedPriceBuilder totalGross(Money totalGross)

      Total gross price of the Order.

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

      public Money getTotalNet()

      Total net price of the Order.

      Returns:
      totalNet
    • getTotalGross

      public Money getTotalGross()

      Total gross price of the Order.

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