Interface ProductChangeMasterVariantAction
- All Superinterfaces:
ProductUpdateAction
,ResourceUpdateAction<ProductUpdateAction>
Assigns the specified Product Variant to the masterVariant
and removes the same from variants
at the same time. The current Master Variant becomes part of the variants
array. Either variantId
or sku
is required.
Example to create an instance using the builder pattern
ProductChangeMasterVariantAction productChangeMasterVariantAction = ProductChangeMasterVariantAction.builder()
.build()
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
discriminator value for ProductChangeMasterVariantAction -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
builder factory method for ProductChangeMasterVariantActionbuilder
(ProductChangeMasterVariantAction template) create builder for ProductChangeMasterVariantAction instancedeepCopy
(ProductChangeMasterVariantAction template) factory method to create a deep copy of ProductChangeMasterVariantActiongetSku()
Thesku
of the ProductVariant to become the Master Variant.Iftrue
, only the staged Master Variant is changed.Theid
of the ProductVariant to become the Master Variant.of()
factory methodof
(ProductChangeMasterVariantAction template) factory method to create a shallow copy ProductChangeMasterVariantActionvoid
Thesku
of the ProductVariant to become the Master Variant.void
Iftrue
, only the staged Master Variant is changed.void
setVariantId
(Long variantId) Theid
of the ProductVariant to become the Master Variant.static com.fasterxml.jackson.core.type.TypeReference<ProductChangeMasterVariantAction>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
accessor map functionMethods inherited from interface com.commercetools.api.models.product.ProductUpdateAction
getAction, withProductUpdateAction
Methods inherited from interface com.commercetools.api.models.ResourceUpdateAction
get
-
Field Details
-
CHANGE_MASTER_VARIANT
discriminator value for ProductChangeMasterVariantAction- See Also:
-
-
Method Details
-
getVariantId
Long getVariantId()The
id
of the ProductVariant to become the Master Variant.- Returns:
- variantId
-
getSku
String getSku()The
sku
of the ProductVariant to become the Master Variant.- Returns:
- sku
-
getStaged
Boolean getStaged()If
true
, only the staged Master Variant is changed. Iffalse
, both the current and staged Master Variant are changed.- Returns:
- staged
-
setVariantId
The
id
of the ProductVariant to become the Master Variant.- Parameters:
variantId
- value to be set
-
setSku
The
sku
of the ProductVariant to become the Master Variant.- Parameters:
sku
- value to be set
-
setStaged
If
true
, only the staged Master Variant is changed. Iffalse
, both the current and staged Master Variant are changed.- Parameters:
staged
- value to be set
-
of
factory method- Returns:
- instance of ProductChangeMasterVariantAction
-
of
factory method to create a shallow copy ProductChangeMasterVariantAction- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
@Nullable static ProductChangeMasterVariantAction deepCopy(@Nullable ProductChangeMasterVariantAction template) factory method to create a deep copy of ProductChangeMasterVariantAction- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for ProductChangeMasterVariantAction- Returns:
- builder
-
builder
create builder for ProductChangeMasterVariantAction instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withProductChangeMasterVariantAction
default <T> T withProductChangeMasterVariantAction(Function<ProductChangeMasterVariantAction, 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<ProductChangeMasterVariantAction> typeReference()gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-