Class OutOfStockErrorBuilder

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

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

     OutOfStockError outOfStockError = OutOfStockError.builder()
             .message("{message}")
             .plusLineItems(lineItemsBuilder -> lineItemsBuilder)
             .plusSkus(skusBuilder -> skusBuilder)
             .build()
 
  • Constructor Details

    • OutOfStockErrorBuilder

      public OutOfStockErrorBuilder()
  • Method Details

    • message

      public OutOfStockErrorBuilder message(String message)

      "Some line items are out of stock at the time of placing the order: $itemSku."

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

      public OutOfStockErrorBuilder values(Map<String,Object> values)

      Error-specific additional fields.

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

      public OutOfStockErrorBuilder addValue(String key, Object value)

      Error-specific additional fields.

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

      public OutOfStockErrorBuilder lineItems(String... lineItems)

      Unique identifiers of the Line Items that are out of stock.

      Parameters:
      lineItems - value to be set
      Returns:
      Builder
    • lineItems

      public OutOfStockErrorBuilder lineItems(List<String> lineItems)

      Unique identifiers of the Line Items that are out of stock.

      Parameters:
      lineItems - value to be set
      Returns:
      Builder
    • plusLineItems

      public OutOfStockErrorBuilder plusLineItems(String... lineItems)

      Unique identifiers of the Line Items that are out of stock.

      Parameters:
      lineItems - value to be set
      Returns:
      Builder
    • skus

      public OutOfStockErrorBuilder skus(String... skus)

      SKUs of the Line Items that are out of stock.

      Parameters:
      skus - value to be set
      Returns:
      Builder
    • skus

      public OutOfStockErrorBuilder skus(List<String> skus)

      SKUs of the Line Items that are out of stock.

      Parameters:
      skus - value to be set
      Returns:
      Builder
    • plusSkus

      public OutOfStockErrorBuilder plusSkus(String... skus)

      SKUs of the Line Items that are out of stock.

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

      public String getMessage()

      "Some line items are out of stock at the time of placing the order: $itemSku."

      Returns:
      message
    • getValues

      public Map<String,Object> getValues()

      Error-specific additional fields.

      Returns:
      pattern properties
    • getLineItems

      public List<String> getLineItems()

      Unique identifiers of the Line Items that are out of stock.

      Returns:
      lineItems
    • getSkus

      public List<String> getSkus()

      SKUs of the Line Items that are out of stock.

      Returns:
      skus
    • build

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

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

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

      public static OutOfStockErrorBuilder of(OutOfStockError template)
      create builder for OutOfStockError instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder