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<com.commercetools.api.models.state.StateUpdateAction>
buildActions(com.commercetools.api.models.state.State oldState, com.commercetools.api.models.state.StateDraft newState)
Compares all the fields (including the roles seeStateUpdateActionUtils.buildRolesUpdateActions(com.commercetools.api.models.state.State, com.commercetools.api.models.state.StateDraft)
) of aState
and aStateDraft
.
-
-
-
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 seeStateUpdateActionUtils.buildRolesUpdateActions(com.commercetools.api.models.state.State, com.commercetools.api.models.state.StateDraft)
) of aState
and aStateDraft
. It returns aList
ofStateUpdateAction
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.
-
-