Class StateSyncUtils
- java.lang.Object
-
- com.commercetools.sync.states.utils.StateSyncUtils
-
public final class StateSyncUtils 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.states.State>>
buildActions(io.sphere.sdk.states.State oldState, io.sphere.sdk.states.StateDraft newState)
Compares all the fields (including the roles seeStateUpdateActionUtils.buildRolesUpdateActions(io.sphere.sdk.states.State, io.sphere.sdk.states.StateDraft)
) of aState
and aStateDraft
.
-
-
-
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 seeStateUpdateActionUtils.buildRolesUpdateActions(io.sphere.sdk.states.State, io.sphere.sdk.states.StateDraft)
) of aState
and aStateDraft
. It returns aList
ofUpdateAction
<State
> as a result. If no update action is needed, for example in case where both theState
and theStateDraft
have the same fields, an emptyList
is returned.- Parameters:
oldState
- theState
which should be updated.newState
- theStateDraft
where we get the new data.- Returns:
- A list of state-specific update actions.
-
-