Class ProductSetDiscountedPriceActionBuilder

java.lang.Object
com.commercetools.api.models.product.ProductSetDiscountedPriceActionBuilder
All Implemented Interfaces:
Builder<ProductSetDiscountedPriceAction>

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

     ProductSetDiscountedPriceAction productSetDiscountedPriceAction = ProductSetDiscountedPriceAction.builder()
             .priceId("{priceId}")
             .build()
 
  • Constructor Details

    • ProductSetDiscountedPriceActionBuilder

      public ProductSetDiscountedPriceActionBuilder()
  • Method Details

    • priceId

      The id of the Price to set the Discount.

      Parameters:
      priceId - value to be set
      Returns:
      Builder
    • staged

      public ProductSetDiscountedPriceActionBuilder staged(@Nullable Boolean staged)

      If true, only the staged Embedded Price is updated. If false, both the current and staged Embedded Price are updated.

      Parameters:
      staged - value to be set
      Returns:
      Builder
    • discounted

      Value to set. If empty, any existing value will be removed. The referenced ProductDiscount must have the Type external, be active, and its predicate must match the referenced Price.

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

      Value to set. If empty, any existing value will be removed. The referenced ProductDiscount must have the Type external, be active, and its predicate must match the referenced Price.

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

      public ProductSetDiscountedPriceActionBuilder discounted(@Nullable DiscountedPriceDraft discounted)

      Value to set. If empty, any existing value will be removed. The referenced ProductDiscount must have the Type external, be active, and its predicate must match the referenced Price.

      Parameters:
      discounted - value to be set
      Returns:
      Builder
    • getPriceId

      public String getPriceId()

      The id of the Price to set the Discount.

      Returns:
      priceId
    • getStaged

      @Nullable public Boolean getStaged()

      If true, only the staged Embedded Price is updated. If false, both the current and staged Embedded Price are updated.

      Returns:
      staged
    • getDiscounted

      @Nullable public DiscountedPriceDraft getDiscounted()

      Value to set. If empty, any existing value will be removed. The referenced ProductDiscount must have the Type external, be active, and its predicate must match the referenced Price.

      Returns:
      discounted
    • build

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

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

      factory method for an instance of ProductSetDiscountedPriceActionBuilder
      Returns:
      builder
    • of

      create builder for ProductSetDiscountedPriceAction instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder