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<com.commercetools.api.models.category.CategoryUpdateAction> buildActions​(com.commercetools.api.models.category.Category oldCategory, com.commercetools.api.models.category.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<com.commercetools.api.models.category.CategoryUpdateAction> buildActions​(@Nonnull
                                                                                                              com.commercetools.api.models.category.Category oldCategory,
                                                                                                              @Nonnull
                                                                                                              com.commercetools.api.models.category.CategoryDraft newCategory,
                                                                                                              @Nonnull
                                                                                                              CategorySyncOptions syncOptions)
        Compares all the fields of a Category and a CategoryDraft. It returns a List of CategoryUpdateAction 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.