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<com.commercetools.api.models.type.TypeUpdateAction>buildActions(com.commercetools.api.models.type.Type oldType, com.commercetools.api.models.type.TypeDraft newType, TypeSyncOptions syncOptions)Compares all the fields (including the field definitions seeTypeUpdateActionUtils.buildFieldDefinitionsUpdateActions(Type, TypeDraft, TypeSyncOptions)) of aTypeand aTypeDraft.
-
-
-
Method Detail
-
buildActions
@Nonnull public static java.util.List<com.commercetools.api.models.type.TypeUpdateAction> buildActions(@Nonnull com.commercetools.api.models.type.Type oldType, @Nonnull com.commercetools.api.models.type.TypeDraft newType, @Nonnull TypeSyncOptions syncOptions)Compares all the fields (including the field definitions seeTypeUpdateActionUtils.buildFieldDefinitionsUpdateActions(Type, TypeDraft, TypeSyncOptions)) of aTypeand aTypeDraft. It returns aListofTypeUpdateActionas a result. If no update actions are needed, for example in case where both theTypeand theTypeDrafthave the same fields, an emptyListis returned.Note: The commercetools API doesn't support the following:
- removing the EnumValue/LocalizedEnumValue of a FieldDefinition
- changing the required field of a FieldDefinition
- Parameters:
oldType- theTypewhich should be updated.newType- theTypeDraftwhere 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 (SeeTypeSyncOptionsfor more info.- Returns:
- A list of type-specific update actions.
-
-