public final class StateSyncUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.states.State>> |
buildActions(io.sphere.sdk.states.State oldState,
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 . |
@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)
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.oldState
- the State
which should be updated.newState
- the StateDraft
where we get the new data.