Class StateSyncUtils


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

      • buildActions

        @Nonnull
        public static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.states.State>> buildActions​(@Nonnull
                                                                                                                   io.sphere.sdk.states.State oldState,
                                                                                                                   @Nonnull
                                                                                                                   io.sphere.sdk.states.StateDraft newState)
        Compares all the fields (including the roles see StateUpdateActionUtils.buildRolesUpdateActions(io.sphere.sdk.states.State, io.sphere.sdk.states.StateDraft)) of a State and a StateDraft. It returns a List of UpdateAction<State> 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.