Class CartDiscountSyncUtils


  • public final class CartDiscountSyncUtils
    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.cartdiscounts.CartDiscount>> buildActions​(io.sphere.sdk.cartdiscounts.CartDiscount oldCartDiscount, io.sphere.sdk.cartdiscounts.CartDiscountDraft newCartDiscount, CartDiscountSyncOptions syncOptions)
      Compares all the fields of a CartDiscount and a CartDiscountDraft.
      • 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.cartdiscounts.CartDiscount>> buildActions​(@Nonnull
                                                                                                                                 io.sphere.sdk.cartdiscounts.CartDiscount oldCartDiscount,
                                                                                                                                 @Nonnull
                                                                                                                                 io.sphere.sdk.cartdiscounts.CartDiscountDraft newCartDiscount,
                                                                                                                                 @Nonnull
                                                                                                                                 CartDiscountSyncOptions syncOptions)
        Compares all the fields of a CartDiscount and a CartDiscountDraft. It returns a List of UpdateAction<CartDiscount> as a result. If no update action is needed, for example in case where both the CartDiscount and the CartDiscountDraft have the same fields, an empty List is returned.
        Parameters:
        oldCartDiscount - the cart discount which should be updated.
        newCartDiscount - the cart discount 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 CartDiscountSyncOptions for more info.
        Returns:
        A list of cart discount specific update actions.