public final class UpdateActionsSortUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.products.Product>> |
sortPriceActions(java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.products.Product>> updateActions)
Given a list of update actions, this method returns a copy of the supplied list but sorted with the following
precedence:
RemovePrice
ChangePrice or SetProductPriceCustomType or SetProductPriceCustomField
AddPrice
|
@Nonnull
public static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.products.Product>> sortPriceActions(@Nonnull
java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.products.Product>> updateActions)
RemovePriceChangePrice or SetProductPriceCustomType or SetProductPriceCustomFieldAddPriceThis 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.
updateActions - list of update actions to sort.