Class ProductSetPricesActionBuilder

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

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

     ProductSetPricesAction productSetPricesAction = ProductSetPricesAction.builder()
             .plusPrices(pricesBuilder -> pricesBuilder)
             .build()
 
  • Constructor Details

    • ProductSetPricesActionBuilder

      public ProductSetPricesActionBuilder()
  • Method Details

    • variantId

      public ProductSetPricesActionBuilder variantId(@Nullable Long variantId)

      The id of the ProductVariant to update.

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

      public ProductSetPricesActionBuilder sku(@Nullable String sku)

      The sku of the ProductVariant to update.

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

      public ProductSetPricesActionBuilder prices(PriceDraft... prices)

      The Embedded Prices to set.

      If any two Embedded Prices in this array have the same key, a DuplicatePriceKey error is returned.

      If any two Embedded Prices in this array have the same price scope, a DuplicatePriceScope error is returned.

      If any two Embedded Prices in this array have overlapping validity periods within the same price scope, an OverlappingPriceValidity error is returned. An Embedded Price without validity period does not conflict with an Embedded Price defined for a time period.

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

      The Embedded Prices to set.

      If any two Embedded Prices in this array have the same key, a DuplicatePriceKey error is returned.

      If any two Embedded Prices in this array have the same price scope, a DuplicatePriceScope error is returned.

      If any two Embedded Prices in this array have overlapping validity periods within the same price scope, an OverlappingPriceValidity error is returned. An Embedded Price without validity period does not conflict with an Embedded Price defined for a time period.

      Parameters:
      prices - value to be set
      Returns:
      Builder
    • plusPrices

      public ProductSetPricesActionBuilder plusPrices(PriceDraft... prices)

      The Embedded Prices to set.

      If any two Embedded Prices in this array have the same key, a DuplicatePriceKey error is returned.

      If any two Embedded Prices in this array have the same price scope, a DuplicatePriceScope error is returned.

      If any two Embedded Prices in this array have overlapping validity periods within the same price scope, an OverlappingPriceValidity error is returned. An Embedded Price without validity period does not conflict with an Embedded Price defined for a time period.

      Parameters:
      prices - value to be set
      Returns:
      Builder
    • plusPrices

      The Embedded Prices to set.

      If any two Embedded Prices in this array have the same key, a DuplicatePriceKey error is returned.

      If any two Embedded Prices in this array have the same price scope, a DuplicatePriceScope error is returned.

      If any two Embedded Prices in this array have overlapping validity periods within the same price scope, an OverlappingPriceValidity error is returned. An Embedded Price without validity period does not conflict with an Embedded Price defined for a time period.

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

      The Embedded Prices to set.

      If any two Embedded Prices in this array have the same key, a DuplicatePriceKey error is returned.

      If any two Embedded Prices in this array have the same price scope, a DuplicatePriceScope error is returned.

      If any two Embedded Prices in this array have overlapping validity periods within the same price scope, an OverlappingPriceValidity error is returned. An Embedded Price without validity period does not conflict with an Embedded Price defined for a time period.

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

      The Embedded Prices to set.

      If any two Embedded Prices in this array have the same key, a DuplicatePriceKey error is returned.

      If any two Embedded Prices in this array have the same price scope, a DuplicatePriceScope error is returned.

      If any two Embedded Prices in this array have overlapping validity periods within the same price scope, an OverlappingPriceValidity error is returned. An Embedded Price without validity period does not conflict with an Embedded Price defined for a time period.

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

      The Embedded Prices to set.

      If any two Embedded Prices in this array have the same key, a DuplicatePriceKey error is returned.

      If any two Embedded Prices in this array have the same price scope, a DuplicatePriceScope error is returned.

      If any two Embedded Prices in this array have overlapping validity periods within the same price scope, an OverlappingPriceValidity error is returned. An Embedded Price without validity period does not conflict with an Embedded Price defined for a time period.

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

      public ProductSetPricesActionBuilder staged(@Nullable Boolean staged)

      Whether only the staged ProductVariant is updated. If false, both the current and staged ProductVariant 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
    • getPrices

      public List<PriceDraft> getPrices()

      The Embedded Prices to set.

      If any two Embedded Prices in this array have the same key, a DuplicatePriceKey error is returned.

      If any two Embedded Prices in this array have the same price scope, a DuplicatePriceScope error is returned.

      If any two Embedded Prices in this array have overlapping validity periods within the same price scope, an OverlappingPriceValidity error is returned. An Embedded Price without validity period does not conflict with an Embedded Price defined for a time period.

      Returns:
      prices
    • getStaged

      @Nullable public Boolean getStaged()

      Whether only the staged ProductVariant is updated. If false, both the current and staged ProductVariant are updated.

      Returns:
      staged
    • build

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

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

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

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