Interface DuplicatePriceKeyError

All Superinterfaces:
ErrorObject

public interface DuplicatePriceKeyError extends ErrorObject

Returned when a Price key conflicts with an existing key.

Keys of Embedded Prices must be unique per ProductVariant.


Example to create an instance using the builder pattern

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

    • DUPLICATE_PRICE_KEY

      static final String DUPLICATE_PRICE_KEY
      discriminator value for DuplicatePriceKeyError
      See Also:
  • Method Details

    • getCode

      @NotNull @NotNull String getCode()
      Description copied from interface: ErrorObject

      Error identifier.

      Specified by:
      getCode in interface ErrorObject
      Returns:
      code
    • getMessage

      @NotNull @NotNull String getMessage()

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

      Specified by:
      getMessage in interface ErrorObject
      Returns:
      message
    • getConflictingPrice

      @NotNull @Valid @NotNull @Valid Price getConflictingPrice()

      Conflicting Embedded Price.

      Returns:
      conflictingPrice
    • setMessage

      void setMessage(String message)

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

      Specified by:
      setMessage in interface ErrorObject
      Parameters:
      message - value to be set
    • setConflictingPrice

      void setConflictingPrice(Price conflictingPrice)

      Conflicting Embedded Price.

      Parameters:
      conflictingPrice - value to be set
    • of

      factory method
      Returns:
      instance of DuplicatePriceKeyError
    • of

      factory method to create a shallow copy DuplicatePriceKeyError
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      factory method to create a deep copy of DuplicatePriceKeyError
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      builder factory method for DuplicatePriceKeyError
      Returns:
      builder
    • builder

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

      default <T> T withDuplicatePriceKeyError(Function<DuplicatePriceKeyError,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<DuplicatePriceKeyError> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference