Class KeepOtherVariantsSync


  • public class KeepOtherVariantsSync
    extends java.lang.Object
    • 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 of ProductUpdateAction's.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • KeepOtherVariantsSync

        public KeepOtherVariantsSync()
    • 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 of ProductUpdateAction's. This method filters out the update action if it is a ProductRemoveVariantAction update 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 comparing newProductDraft and oldProduct.
        Returns:
        the same list of supplied updateActions without ProductRemoveVariantAction update actions.