Interface ProductPresentWithDifferentVariantSelectionError
- All Superinterfaces:
ErrorObject
- All Known Implementing Classes:
ProductPresentWithDifferentVariantSelectionErrorImpl
Returned when a Product is already assigned to a Product Selection, but the Product Selection has either a different Product Variant Selection or a different Product Variant Exclusion.
The error is returned as a failed response either to the Add Product or to the Exclude Product update action.
Example to create an instance using the builder pattern
ProductPresentWithDifferentVariantSelectionError productPresentWithDifferentVariantSelectionError = ProductPresentWithDifferentVariantSelectionError.builder()
.message("{message}")
.product(productBuilder -> productBuilder)
.existingVariantSelection(existingVariantSelectionBuilder -> existingVariantSelectionBuilder)
.build()
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
discriminator value for ProductPresentWithDifferentVariantSelectionError -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
builder factory method for ProductPresentWithDifferentVariantSelectionErrorcreate builder for ProductPresentWithDifferentVariantSelectionError instancefactory method to create a deep copy of ProductPresentWithDifferentVariantSelectionError@NotNull String
getCode()
Error identifier.@NotNull @Valid ProductVariantSelection
Existing Product Variant Selection or Exclusion for the Product in the Product Selection.@NotNull String
"Product is already present with the following different $variantSelections."
@NotNull @Valid ProductReference
Reference to the Product for which the error was returned.of()
factory methodfactory method to create a shallow copy ProductPresentWithDifferentVariantSelectionErrorvoid
setExistingVariantSelection
(ProductVariantSelection existingVariantSelection) Existing Product Variant Selection or Exclusion for the Product in the Product Selection.void
setMessage
(String message) "Product is already present with the following different $variantSelections."
void
setProduct
(ProductReference product) Reference to the Product for which the error was returned.static com.fasterxml.jackson.core.type.TypeReference<ProductPresentWithDifferentVariantSelectionError>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withProductPresentWithDifferentVariantSelectionError
(Function<ProductPresentWithDifferentVariantSelectionError, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.error.ErrorObject
setValue, values, withErrorObject
-
Field Details
-
PRODUCT_PRESENT_WITH_DIFFERENT_VARIANT_SELECTION
discriminator value for ProductPresentWithDifferentVariantSelectionError- See Also:
-
-
Method Details
-
getCode
Description copied from interface:ErrorObject
Error identifier.
- Specified by:
getCode
in interfaceErrorObject
- Returns:
- code
-
getMessage
"Product is already present with the following different $variantSelections."
- Specified by:
getMessage
in interfaceErrorObject
- Returns:
- message
-
getProduct
Reference to the Product for which the error was returned.
- Returns:
- product
-
getExistingVariantSelection
Existing Product Variant Selection or Exclusion for the Product in the Product Selection.
- Returns:
- existingVariantSelection
-
setMessage
"Product is already present with the following different $variantSelections."
- Specified by:
setMessage
in interfaceErrorObject
- Parameters:
message
- value to be set
-
setProduct
Reference to the Product for which the error was returned.
- Parameters:
product
- value to be set
-
setExistingVariantSelection
Existing Product Variant Selection or Exclusion for the Product in the Product Selection.
- Parameters:
existingVariantSelection
- value to be set
-
of
factory method- Returns:
- instance of ProductPresentWithDifferentVariantSelectionError
-
of
static ProductPresentWithDifferentVariantSelectionError of(ProductPresentWithDifferentVariantSelectionError template) factory method to create a shallow copy ProductPresentWithDifferentVariantSelectionError- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
@Nullable static ProductPresentWithDifferentVariantSelectionError deepCopy(@Nullable ProductPresentWithDifferentVariantSelectionError template) factory method to create a deep copy of ProductPresentWithDifferentVariantSelectionError- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for ProductPresentWithDifferentVariantSelectionError- Returns:
- builder
-
builder
static ProductPresentWithDifferentVariantSelectionErrorBuilder builder(ProductPresentWithDifferentVariantSelectionError template) create builder for ProductPresentWithDifferentVariantSelectionError instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withProductPresentWithDifferentVariantSelectionError
default <T> T withProductPresentWithDifferentVariantSelectionError(Function<ProductPresentWithDifferentVariantSelectionError, 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<ProductPresentWithDifferentVariantSelectionError> typeReference()gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-