Class PriceChangedErrorBuilder

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

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

     PriceChangedError priceChangedError = PriceChangedError.builder()
             .message("{message}")
             .plusLineItems(lineItemsBuilder -> lineItemsBuilder)
             .shipping(true)
             .build()
 
  • Constructor Details

    • PriceChangedErrorBuilder

      public PriceChangedErrorBuilder()
  • Method Details

    • message

      public PriceChangedErrorBuilder message(String message)

      Plain text description of the reason for the Price change. For example, "The price or tax of some line items changed at the time of placing the order: $lineItems.".

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

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

      Error-specific additional fields.

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

      public PriceChangedErrorBuilder addValue(String key, Object value)

      Error-specific additional fields.

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

      public PriceChangedErrorBuilder lineItems(String... lineItems)

      Unique identifiers of the Line Items for which the Price or TaxRate has changed.

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

      public PriceChangedErrorBuilder lineItems(List<String> lineItems)

      Unique identifiers of the Line Items for which the Price or TaxRate has changed.

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

      public PriceChangedErrorBuilder plusLineItems(String... lineItems)

      Unique identifiers of the Line Items for which the Price or TaxRate has changed.

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

      public PriceChangedErrorBuilder shipping(Boolean shipping)

      true if the ShippingRate has changed.

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

      public String getMessage()

      Plain text description of the reason for the Price change. For example, "The price or tax of some line items changed at the time of placing the order: $lineItems.".

      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 for which the Price or TaxRate has changed.

      Returns:
      lineItems
    • getShipping

      public Boolean getShipping()

      true if the ShippingRate has changed.

      Returns:
      shipping
    • build

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

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

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

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