Interface PriceChangedError
- All Superinterfaces:
ErrorObject
Returned when the Price or Tax Rate of some Line Items or Shipping Rate of some Shipping Methods changed since they were last added to the Cart.
When a Cart is frozen, the error can be returned as a failed response to all update actions on Carts and My Carts.
The error is also returned as a failed response to:
- Create Order from Cart and Create Order in Store from Cart requests on Orders.
- Create Order from Cart and Create Order in Store from Cart requests on My Orders.
- Create Order from Cart in BusinessUnit request on Associate Orders.
Example to create an instance using the builder pattern
PriceChangedError priceChangedError = PriceChangedError.builder()
.message("{message}")
.plusLineItems(lineItemsBuilder -> lineItemsBuilder)
.shipping(true)
.build()
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic PriceChangedErrorBuilderbuilder()builder factory method for PriceChangedErrorstatic PriceChangedErrorBuilderbuilder(PriceChangedError template) create builder for PriceChangedError instancecopyDeep()static PriceChangedErrordeepCopy(PriceChangedError template) factory method to create a deep copy of PriceChangedError@NotNull StringgetCode()Error identifier.Unique identifiers of the Line Items for which the Price or TaxRate has changed.@NotNull StringPlain text description of the reason for the Price change.@NotNull Booleantrueif the ShippingRate has changed.static PriceChangedErrorof()factory methodstatic PriceChangedErrorof(PriceChangedError template) factory method to create a shallow copy PriceChangedErrorvoidsetLineItems(String... lineItems) Unique identifiers of the Line Items for which the Price or TaxRate has changed.voidsetLineItems(List<String> lineItems) Unique identifiers of the Line Items for which the Price or TaxRate has changed.voidsetMessage(String message) Plain text description of the reason for the Price change.voidsetShipping(Boolean shipping) trueif the ShippingRate has changed.static com.fasterxml.jackson.core.type.TypeReference<PriceChangedError>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithPriceChangedError(Function<PriceChangedError, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.error.ErrorObject
setValue, values, withErrorObject
-
Field Details
-
PRICE_CHANGED
discriminator value for PriceChangedError- See Also:
-
-
Method Details
-
getCode
Description copied from interface:ErrorObjectError identifier.
- Specified by:
getCodein interfaceErrorObject- Returns:
- code
-
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.".- Specified by:
getMessagein interfaceErrorObject- Returns:
- message
-
getLineItems
Unique identifiers of the Line Items for which the Price or TaxRate has changed.
- Returns:
- lineItems
-
getShipping
trueif the ShippingRate has changed.- Returns:
- shipping
-
setMessage
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.".- Specified by:
setMessagein interfaceErrorObject- Parameters:
message- value to be set
-
setLineItems
Unique identifiers of the Line Items for which the Price or TaxRate has changed.
- Parameters:
lineItems- values to be set
-
setLineItems
Unique identifiers of the Line Items for which the Price or TaxRate has changed.
- Parameters:
lineItems- values to be set
-
setShipping
trueif the ShippingRate has changed.- Parameters:
shipping- value to be set
-
of
factory method- Returns:
- instance of PriceChangedError
-
of
factory method to create a shallow copy PriceChangedError- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
PriceChangedError copyDeep()- Specified by:
copyDeepin interfaceErrorObject
-
deepCopy
factory method to create a deep copy of PriceChangedError- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for PriceChangedError- Returns:
- builder
-
builder
create builder for PriceChangedError instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withPriceChangedError
accessor map function- Type Parameters:
T- mapped type- Parameters:
helper- function to map the object- Returns:
- mapped value
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-