Class DuplicatePriceKeyErrorBuilder

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

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

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

    • DuplicatePriceKeyErrorBuilder

      public DuplicatePriceKeyErrorBuilder()
  • Method Details

    • message

      public DuplicatePriceKeyErrorBuilder message(String message)

      "Duplicate price key: $priceKey. The price key must be unique per variant."

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

      Error-specific additional fields.

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

      public DuplicatePriceKeyErrorBuilder 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 DuplicatePriceKeyErrorBuilder withConflictingPrice(Function<PriceBuilder,Price> builder)

      Conflicting Embedded Price.

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

      public DuplicatePriceKeyErrorBuilder conflictingPrice(Price conflictingPrice)

      Conflicting Embedded Price.

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

      public String getMessage()

      "Duplicate price key: $priceKey. The price key must be unique per 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 DuplicatePriceKeyError build()
      builds DuplicatePriceKeyError with checking for non-null required values
      Specified by:
      build in interface Builder<DuplicatePriceKeyError>
      Returns:
      DuplicatePriceKeyError
    • buildUnchecked

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

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

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