Class KeepOtherVariantsSync
- java.lang.Object
-
- com.commercetools.sync.products.templates.beforeupdatecallback.KeepOtherVariantsSync
-
public class KeepOtherVariantsSync extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description KeepOtherVariantsSync()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.List<com.commercetools.api.models.product.ProductUpdateAction>keepOtherVariants(java.util.List<com.commercetools.api.models.product.ProductUpdateAction> updateActions)Takes a list ofProductUpdateAction's.
-
-
-
Method Detail
-
keepOtherVariants
public static java.util.List<com.commercetools.api.models.product.ProductUpdateAction> keepOtherVariants(@Nonnull java.util.List<com.commercetools.api.models.product.ProductUpdateAction> updateActions)Takes a list ofProductUpdateAction's. This method filters out the update action if it is aProductRemoveVariantActionupdate action.Using this method as a BeforeUpdateCallback would prevent the removal of not existing variants in the target product.
- Parameters:
updateActions- the update action built from comparingnewProductDraftandoldProduct.- Returns:
- the same list of supplied
updateActionswithoutProductRemoveVariantActionupdate actions.
-
-