Class UpdateActionsSortUtils
- java.lang.Object
-
- com.commercetools.sync.products.utils.UpdateActionsSortUtils
-
public final class UpdateActionsSortUtils extends java.lang.Object
This class is only meant for the internal use of the commercetools-sync-java library.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.List<com.commercetools.api.models.product.ProductUpdateAction>
sortPriceActions(java.util.List<com.commercetools.api.models.product.ProductUpdateAction> updateActions)
Given a list of update actions, this method returns a copy of the supplied list but sorted with the following precedence:ProductRemovePriceAction
ProductChangePriceAction
orProductSetProductPriceCustomTypeAction
orProductSetProductPriceCustomFieldAction
ProductAddPriceAction
-
-
-
Method Detail
-
sortPriceActions
@Nonnull public static java.util.List<com.commercetools.api.models.product.ProductUpdateAction> sortPriceActions(@Nonnull java.util.List<com.commercetools.api.models.product.ProductUpdateAction> updateActions)
Given a list of update actions, this method returns a copy of the supplied list but sorted with the following precedence:ProductRemovePriceAction
ProductChangePriceAction
orProductSetProductPriceCustomTypeAction
orProductSetProductPriceCustomFieldAction
ProductAddPriceAction
This is to ensure that there are no conflicts when adding a new price that might have a duplicate value for a unique field, which could already be changed or removed.
- Parameters:
updateActions
- list of update actions to sort.- Returns:
- a new sorted list of update actions (remove, change, add).
-
-