Class ProductAddPriceActionBuilder

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

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

     ProductAddPriceAction productAddPriceAction = ProductAddPriceAction.builder()
             .price(priceBuilder -> priceBuilder)
             .build()
 
  • Constructor Details

    • ProductAddPriceActionBuilder

      public ProductAddPriceActionBuilder()
  • Method Details

    • variantId

      public ProductAddPriceActionBuilder variantId(@Nullable Long variantId)

      The id of the ProductVariant to update.

      Parameters:
      variantId - value to be set
      Returns:
      Builder
    • sku

      public ProductAddPriceActionBuilder sku(@Nullable String sku)

      The sku of the ProductVariant to update.

      Parameters:
      sku - value to be set
      Returns:
      Builder
    • price

      Embedded Price to add to the Product Variant.

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

      Embedded Price to add to the Product Variant.

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

      Embedded Price to add to the Product Variant.

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

      public ProductAddPriceActionBuilder staged(@Nullable Boolean staged)

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

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

      @Nullable public Long getVariantId()

      The id of the ProductVariant to update.

      Returns:
      variantId
    • getSku

      @Nullable public String getSku()

      The sku of the ProductVariant to update.

      Returns:
      sku
    • getPrice

      public PriceDraft getPrice()

      Embedded Price to add to the Product Variant.

      Returns:
      price
    • getStaged

      @Nullable public Boolean getStaged()

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

      Returns:
      staged
    • build

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

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

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

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