Class BestDealBuilder

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

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

     BestDeal bestDeal = BestDeal.builder()
             .chosenDiscountType("{chosenDiscountType}")
             .build()
 
  • Constructor Details

    • BestDealBuilder

      public BestDealBuilder()
  • Method Details

    • chosenDiscountType

      public BestDealBuilder chosenDiscountType(String chosenDiscountType)

      Discount type that offers the best deal; the value can be product-discount or cart-discount.

      Parameters:
      chosenDiscountType - value to be set
      Returns:
      Builder
    • getChosenDiscountType

      public String getChosenDiscountType()

      Discount type that offers the best deal; the value can be product-discount or cart-discount.

      Returns:
      chosenDiscountType
    • build

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

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

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

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