Class ProductChangePriceActionBuilder

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

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

     ProductChangePriceAction productChangePriceAction = ProductChangePriceAction.builder()
             .priceId("{priceId}")
             .price(priceBuilder -> priceBuilder)
             .build()
 
  • Constructor Details

    • ProductChangePriceActionBuilder

      public ProductChangePriceActionBuilder()
  • Method Details

    • priceId

      public ProductChangePriceActionBuilder priceId(String priceId)

      The id of the Embedded Price to update.

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

      Value to set.

      If the key of the Price is used by another Embedded Price on the ProductVariant, a DuplicatePriceKey error is returned.

      If the new Embedded Price has the same price scope as another Embedded Price on the ProductVariant, a DuplicatePriceScope error is returned.

      If the new Embedded Price has 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 price value
      Returns:
      Builder
    • withPrice

      Value to set.

      If the key of the Price is used by another Embedded Price on the ProductVariant, a DuplicatePriceKey error is returned.

      If the new Embedded Price has the same price scope as another Embedded Price on the ProductVariant, a DuplicatePriceScope error is returned.

      If the new Embedded Price has 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 price value
      Returns:
      Builder
    • price

      Value to set.

      If the key of the Price is used by another Embedded Price on the ProductVariant, a DuplicatePriceKey error is returned.

      If the new Embedded Price has the same price scope as another Embedded Price on the ProductVariant, a DuplicatePriceScope error is returned.

      If the new Embedded Price has 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:
      price - value to be set
      Returns:
      Builder
    • staged

      public ProductChangePriceActionBuilder staged(@Nullable Boolean staged)

      Whether 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
    • getPriceId

      public String getPriceId()

      The id of the Embedded Price to update.

      Returns:
      priceId
    • getPrice

      public PriceDraft getPrice()

      Value to set.

      If the key of the Price is used by another Embedded Price on the ProductVariant, a DuplicatePriceKey error is returned.

      If the new Embedded Price has the same price scope as another Embedded Price on the ProductVariant, a DuplicatePriceScope error is returned.

      If the new Embedded Price has 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:
      price
    • getStaged

      @Nullable public Boolean getStaged()

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

      Returns:
      staged
    • build

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

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

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

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