Class CustomerSyncUtils


  • public final class CustomerSyncUtils
    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.customer.CustomerUpdateAction> buildActions​(com.commercetools.api.models.customer.Customer oldCustomer, com.commercetools.api.models.customer.CustomerDraft newCustomer, CustomerSyncOptions syncOptions)
      Compares all the fields of a Customer and a CustomerDraft.
      • 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.customer.CustomerUpdateAction> buildActions​(@Nonnull
                                                                                                              com.commercetools.api.models.customer.Customer oldCustomer,
                                                                                                              @Nonnull
                                                                                                              com.commercetools.api.models.customer.CustomerDraft newCustomer,
                                                                                                              @Nonnull
                                                                                                              CustomerSyncOptions syncOptions)
        Compares all the fields of a Customer and a CustomerDraft. It returns a List of CustomerUpdateAction as a result. If no update action is needed, for example in case where both the CustomerDraft and the CustomerDraft have the same fields, an empty List is returned.
        Parameters:
        oldCustomer - the customer which should be updated.
        newCustomer - the customer 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 CustomerSyncOptions for more info.
        Returns:
        A list of customer specific update actions.