Class CategorySyncUtils


  • public final class CategorySyncUtils
    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.categories.Category>> buildActions​(io.sphere.sdk.categories.Category oldCategory, io.sphere.sdk.categories.CategoryDraft newCategory, CategorySyncOptions syncOptions)
      Compares all the fields of a Category and a CategoryDraft.
      • 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.categories.Category>> buildActions​(@Nonnull
                                                                                                                          io.sphere.sdk.categories.Category oldCategory,
                                                                                                                          @Nonnull
                                                                                                                          io.sphere.sdk.categories.CategoryDraft newCategory,
                                                                                                                          @Nonnull
                                                                                                                          CategorySyncOptions syncOptions)
        Compares all the fields of a Category and a CategoryDraft. It returns a List of UpdateAction<Category> as a result. If no update action is needed, for example in case where both the Category and the CategoryDraft have the same parents, an empty List is returned.
        Parameters:
        oldCategory - the category which should be updated.
        newCategory - the category 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 BaseSyncOptions for more info.
        Returns:
        A list of category-specific update actions.