Interface ProductSelectionAddProductAction
- All Superinterfaces:
ProductSelectionUpdateAction
,ResourceUpdateAction<ProductSelectionUpdateAction>
Adds a Product to the Product Selection.
If the specified Product is already assigned to the Product Selection, but the existing Product Selection has a different Product Variant Selection, a ProductPresentWithDifferentVariantSelection error is returned.
Example to create an instance using the builder pattern
ProductSelectionAddProductAction productSelectionAddProductAction = ProductSelectionAddProductAction.builder()
.product(productBuilder -> productBuilder)
.build()
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
discriminator value for ProductSelectionAddProductAction -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
builder factory method for ProductSelectionAddProductActionbuilder
(ProductSelectionAddProductAction template) create builder for ProductSelectionAddProductAction instancedeepCopy
(ProductSelectionAddProductAction template) factory method to create a deep copy of ProductSelectionAddProductAction@NotNull @Valid ProductResourceIdentifier
ResourceIdentifier of the Product@Valid ProductVariantSelection
Defines which Variants of the Product will be included in the Product Selection.of()
factory methodof
(ProductSelectionAddProductAction template) factory method to create a shallow copy ProductSelectionAddProductActionvoid
setProduct
(ProductResourceIdentifier product) ResourceIdentifier of the Productvoid
setVariantSelection
(ProductVariantSelection variantSelection) Defines which Variants of the Product will be included in the Product Selection.static com.fasterxml.jackson.core.type.TypeReference<ProductSelectionAddProductAction>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
accessor map functionMethods inherited from interface com.commercetools.api.models.product_selection.ProductSelectionUpdateAction
getAction, withProductSelectionUpdateAction
Methods inherited from interface com.commercetools.api.models.ResourceUpdateAction
get
-
Field Details
-
ADD_PRODUCT
discriminator value for ProductSelectionAddProductAction- See Also:
-
-
Method Details
-
getProduct
ResourceIdentifier of the Product
- Returns:
- product
-
getVariantSelection
Defines which Variants of the Product will be included in the Product Selection. If not supplied all Variants are deemed to be included.
- Returns:
- variantSelection
-
setProduct
ResourceIdentifier of the Product
- Parameters:
product
- value to be set
-
setVariantSelection
Defines which Variants of the Product will be included in the Product Selection. If not supplied all Variants are deemed to be included.
- Parameters:
variantSelection
- value to be set
-
of
factory method- Returns:
- instance of ProductSelectionAddProductAction
-
of
factory method to create a shallow copy ProductSelectionAddProductAction- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
@Nullable static ProductSelectionAddProductAction deepCopy(@Nullable ProductSelectionAddProductAction template) factory method to create a deep copy of ProductSelectionAddProductAction- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for ProductSelectionAddProductAction- Returns:
- builder
-
builder
create builder for ProductSelectionAddProductAction instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withProductSelectionAddProductAction
default <T> T withProductSelectionAddProductAction(Function<ProductSelectionAddProductAction, 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<ProductSelectionAddProductAction> typeReference()gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-