public class KeepOtherVariantsSync
extends java.lang.Object
Constructor and Description |
---|
KeepOtherVariantsSync() |
Modifier and Type | Method and Description |
---|---|
static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.products.Product>> |
keepOtherVariants(java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.products.Product>> updateActions)
Takes product update actions, a new
ProductDraft , an old existing Product . |
public static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.products.Product>> keepOtherVariants(@Nonnull java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.products.Product>> updateActions)
ProductDraft
, an old existing Product
. This
method filters out the update action if it is a RemoveVariant
update action.
Using this method as a BeforeUpdateCallback would prevent the removal of not existing variants in the target product.
updateActions
- the update action built from comparing newProductDraft
and oldProduct
.updateActions
without RemoveVariant
update
actions.