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,
io.sphere.sdk.products.ProductDraft newProductDraft,
io.sphere.sdk.products.Product oldProduct)
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,
@Nonnull
io.sphere.sdk.products.ProductDraft newProductDraft,
@Nonnull
io.sphere.sdk.products.Product oldProduct)
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.newProductDraft - the new ProductDraft being synced.oldProduct - the old existing Product.updateActions without RemoveVariant update actions.