Class SetDiscountedPriceChangeBuilder

java.lang.Object
com.commercetools.history.models.change.SetDiscountedPriceChangeBuilder
All Implemented Interfaces:
Builder<SetDiscountedPriceChange>

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

     SetDiscountedPriceChange setDiscountedPriceChange = SetDiscountedPriceChange.builder()
             .change("{change}")
             .previousValue(previousValueBuilder -> previousValueBuilder)
             .nextValue(nextValueBuilder -> nextValueBuilder)
             .catalogData("{catalogData}")
             .variant("{variant}")
             .priceId("{priceId}")
             .build()
 
  • Constructor Details

    • SetDiscountedPriceChangeBuilder

      public SetDiscountedPriceChangeBuilder()
  • Method Details

    • change

      public SetDiscountedPriceChangeBuilder change(String change)
      set the value to the change
      Parameters:
      change - value to be set
      Returns:
      Builder
    • previousValue

      Value before the change.

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

      public SetDiscountedPriceChangeBuilder withPreviousValue(Function<PriceBuilder,Price> builder)

      Value before the change.

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

      public SetDiscountedPriceChangeBuilder previousValue(Price previousValue)

      Value before the change.

      Parameters:
      previousValue - value to be set
      Returns:
      Builder
    • nextValue

      Value after the change.

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

      Value after the change.

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

      public SetDiscountedPriceChangeBuilder nextValue(Price nextValue)

      Value after the change.

      Parameters:
      nextValue - value to be set
      Returns:
      Builder
    • catalogData

      public SetDiscountedPriceChangeBuilder catalogData(String catalogData)
      • staged, if the staged ProductCatalogData was updated.
      • current, if the current ProductCatalogData was updated.
      Parameters:
      catalogData - value to be set
      Returns:
      Builder
    • variant

      public SetDiscountedPriceChangeBuilder variant(String variant)

      sku or key of the updated ProductVariant.

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

      public SetDiscountedPriceChangeBuilder priceId(String priceId)

      id of the Embedded Price.

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

      public String getChange()
      value of change}
      Returns:
      change
    • getPreviousValue

      public Price getPreviousValue()

      Value before the change.

      Returns:
      previousValue
    • getNextValue

      public Price getNextValue()

      Value after the change.

      Returns:
      nextValue
    • getCatalogData

      public String getCatalogData()
      • staged, if the staged ProductCatalogData was updated.
      • current, if the current ProductCatalogData was updated.
      Returns:
      catalogData
    • getVariant

      public String getVariant()

      sku or key of the updated ProductVariant.

      Returns:
      variant
    • getPriceId

      public String getPriceId()

      id of the Embedded Price.

      Returns:
      priceId
    • build

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

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

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

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