Class DuplicatePriceScopeErrorBuilder

java.lang.Object
com.commercetools.api.models.error.DuplicatePriceScopeErrorBuilder
All Implemented Interfaces:
Builder<DuplicatePriceScopeError>

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

     DuplicatePriceScopeError duplicatePriceScopeError = DuplicatePriceScopeError.builder()
             .message("{message}")
             .conflictingPrice(conflictingPriceBuilder -> conflictingPriceBuilder)
             .build()
 
  • Constructor Details

    • DuplicatePriceScopeErrorBuilder

      public DuplicatePriceScopeErrorBuilder()
  • Method Details

    • message

      public DuplicatePriceScopeErrorBuilder message(String message)

      "Duplicate price scope: $priceScope. The combination of currency, country, customerGroup and channel must be unique for each price of a product variant."

      Parameters:
      message - value to be set
      Returns:
      Builder
    • values

      Error-specific additional fields.

      Parameters:
      values - properties to be set
      Returns:
      Builder
    • addValue

      public DuplicatePriceScopeErrorBuilder addValue(String key, Object value)

      Error-specific additional fields.

      Parameters:
      key - property name
      value - property value
      Returns:
      Builder
    • conflictingPrice

      Conflicting Embedded Price.

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

      public DuplicatePriceScopeErrorBuilder withConflictingPrice(Function<PriceBuilder,Price> builder)

      Conflicting Embedded Price.

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

      public DuplicatePriceScopeErrorBuilder conflictingPrice(Price conflictingPrice)

      Conflicting Embedded Price.

      Parameters:
      conflictingPrice - value to be set
      Returns:
      Builder
    • getMessage

      public String getMessage()

      "Duplicate price scope: $priceScope. The combination of currency, country, customerGroup and channel must be unique for each price of a product variant."

      Returns:
      message
    • getValues

      public Map<String,Object> getValues()

      Error-specific additional fields.

      Returns:
      pattern properties
    • getConflictingPrice

      public Price getConflictingPrice()

      Conflicting Embedded Price.

      Returns:
      conflictingPrice
    • build

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

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

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

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