Class ShoppingListSyncUtils


  • public final class ShoppingListSyncUtils
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.shoppinglists.ShoppingList>> buildActions​(io.sphere.sdk.shoppinglists.ShoppingList oldShoppingList, io.sphere.sdk.shoppinglists.ShoppingListDraft newShoppingList, ShoppingListSyncOptions syncOptions)
      Compares all the fields of a ShoppingList and a ShoppingListDraft.
      • Methods inherited from class java.lang.Object

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

      • buildActions

        @Nonnull
        public static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.shoppinglists.ShoppingList>> buildActions​(@Nonnull
                                                                                                                                 io.sphere.sdk.shoppinglists.ShoppingList oldShoppingList,
                                                                                                                                 @Nonnull
                                                                                                                                 io.sphere.sdk.shoppinglists.ShoppingListDraft newShoppingList,
                                                                                                                                 @Nonnull
                                                                                                                                 ShoppingListSyncOptions syncOptions)
        Compares all the fields of a ShoppingList and a ShoppingListDraft. It returns a List of UpdateAction<ShoppingList> as a result. If no update action is needed, for example in case where both the ShoppingListDraft and the ShoppingList have the same fields, an empty List is returned.
        Parameters:
        oldShoppingList - the shopping list which should be updated.
        newShoppingList - the shopping list draft where we get the new data.
        syncOptions - the sync options wrapper which contains options related to the sync process supplied by the user. For example, custom callbacks to call in case of warnings or errors occurring on the build update action process. And other options (See ShoppingListSyncOptions for more info.
        Returns:
        A list of shopping list specific update actions.