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
FieldsModifier and TypeFieldDescriptionstatic final Stringdiscriminator value for ProductChangeMasterVariantAction -
Method Summary
Modifier and TypeMethodDescriptionbuilder()builder factory method for ProductChangeMasterVariantActionbuilder(ProductChangeMasterVariantAction template) create builder for ProductChangeMasterVariantAction instancecopyDeep()deepCopy(ProductChangeMasterVariantAction template) factory method to create a deep copy of ProductChangeMasterVariantActiongetSku()Theskuof the ProductVariant to become the Master Variant.Iftrue, only the staged Master Variant is changed.Theidof the ProductVariant to become the Master Variant.of()factory methodof(ProductChangeMasterVariantAction template) factory method to create a shallow copy ProductChangeMasterVariantActionvoidTheskuof the ProductVariant to become the Master Variant.voidIftrue, only the staged Master Variant is changed.voidsetVariantId(Long variantId) Theidof the ProductVariant to become the Master Variant.static com.fasterxml.jackson.core.type.TypeReference<ProductChangeMasterVariantAction>gives a TypeReference for usage with Jackson DataBinddefault <T> Taccessor map functionMethods inherited from interface com.commercetools.api.models.product.ProductUpdateAction
getAction, withProductUpdateActionMethods 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
idof the ProductVariant to become the Master Variant.- Returns:
- variantId
-
getSku
String getSku()The
skuof 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
idof the ProductVariant to become the Master Variant.- Parameters:
variantId- value to be set
-
setSku
The
skuof 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
-
copyDeep
ProductChangeMasterVariantAction copyDeep()- Specified by:
copyDeepin interfaceProductUpdateAction
-
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
-