Class StateSyncUtils


  • public final class StateSyncUtils
    extends java.lang.Object
    • Method Detail

      • buildActions

        @Nonnull
        public static java.util.List<com.commercetools.api.models.state.StateUpdateAction> buildActions​(@Nonnull
                                                                                                        com.commercetools.api.models.state.State oldState,
                                                                                                        @Nonnull
                                                                                                        com.commercetools.api.models.state.StateDraft newState)
        Compares all the fields (including the roles see StateUpdateActionUtils.buildRolesUpdateActions(com.commercetools.api.models.state.State, com.commercetools.api.models.state.StateDraft)) of a State and a StateDraft. It returns a List of StateUpdateAction as a result. If no update action is needed, for example in case where both the State and the StateDraft have the same fields, an empty List is returned.
        Parameters:
        oldState - the State which should be updated.
        newState - the StateDraft where we get the new data.
        Returns:
        A list of state-specific update actions.