Class TypeSyncUtils
- java.lang.Object
-
- com.commercetools.sync.types.utils.TypeSyncUtils
-
public final class TypeSyncUtils 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.types.Type>>
buildActions(io.sphere.sdk.types.Type oldType, io.sphere.sdk.types.TypeDraft newType, TypeSyncOptions syncOptions)
Compares all the fields (including the field definitions seeTypeUpdateActionUtils.buildFieldDefinitionsUpdateActions(Type, TypeDraft, TypeSyncOptions)
) of aType
and aTypeDraft
.
-
-
-
Method Detail
-
buildActions
@Nonnull public static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.types.Type>> buildActions(@Nonnull io.sphere.sdk.types.Type oldType, @Nonnull io.sphere.sdk.types.TypeDraft newType, @Nonnull TypeSyncOptions syncOptions)
Compares all the fields (including the field definitions seeTypeUpdateActionUtils.buildFieldDefinitionsUpdateActions(Type, TypeDraft, TypeSyncOptions)
) of aType
and aTypeDraft
. It returns aList
ofUpdateAction
<Type
> as a result. If no update actions are needed, for example in case where both theType
and theTypeDraft
have the same fields, an emptyList
is returned.Note: Currently this util doesn't support the following:
- updating the inputHint of a FieldDefinition
- removing the EnumValue/LocalizedEnumValue of a FieldDefinition
- updating the label of a EnumValue/LocalizedEnumValue of a FieldDefinition
- Parameters:
oldType
- theType
which should be updated.newType
- theTypeDraft
where we get the new data.syncOptions
- the sync options wrapper which contains options related to the sync process supplied by the user. For example, custom callbacks to call in case of warnings or errors occurring on the build update action process. And other options (SeeTypeSyncOptions
for more info.- Returns:
- A list of type-specific update actions.
-
-