Class CustomObjectBatchValidator
- java.lang.Object
-
- com.commercetools.sync.commons.helpers.BaseBatchValidator<com.commercetools.api.models.custom_object.CustomObjectDraft,CustomObjectSyncOptions,CustomObjectSyncStatistics>
-
- com.commercetools.sync.customobjects.helpers.CustomObjectBatchValidator
-
public class CustomObjectBatchValidator extends BaseBatchValidator<com.commercetools.api.models.custom_object.CustomObjectDraft,CustomObjectSyncOptions,CustomObjectSyncStatistics>
-
-
Constructor Summary
Constructors Constructor Description CustomObjectBatchValidator(CustomObjectSyncOptions syncOptions, CustomObjectSyncStatistics syncStatistics)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.commons.lang3.tuple.ImmutablePair<java.util.Set<com.commercetools.api.models.custom_object.CustomObjectDraft>,java.util.Set<CustomObjectCompositeIdentifier>>
validateAndCollectReferencedKeys(java.util.List<com.commercetools.api.models.custom_object.CustomObjectDraft> customObjectDrafts)
Given theList
<CustomObjectDraft
> of drafts this method attempts to validate drafts and return anImmutablePair
<Set
<CustomObjectDraft
>,Set
<CustomObjectCompositeIdentifier
>> which contains theSet
of valid drafts and valid custom object identifiers (container with key).-
Methods inherited from class com.commercetools.sync.commons.helpers.BaseBatchValidator
collectReferencedKeyFromCustomFieldsDraft, collectReferencedKeyFromResourceIdentifier, collectReferencedKeysFromAssetDrafts, handleError, handleError
-
-
-
-
Constructor Detail
-
CustomObjectBatchValidator
public CustomObjectBatchValidator(@Nonnull CustomObjectSyncOptions syncOptions, @Nonnull CustomObjectSyncStatistics syncStatistics)
-
-
Method Detail
-
validateAndCollectReferencedKeys
public org.apache.commons.lang3.tuple.ImmutablePair<java.util.Set<com.commercetools.api.models.custom_object.CustomObjectDraft>,java.util.Set<CustomObjectCompositeIdentifier>> validateAndCollectReferencedKeys(@Nonnull java.util.List<com.commercetools.api.models.custom_object.CustomObjectDraft> customObjectDrafts)
Given theList
<CustomObjectDraft
> of drafts this method attempts to validate drafts and return anImmutablePair
<Set
<CustomObjectDraft
>,Set
<CustomObjectCompositeIdentifier
>> which contains theSet
of valid drafts and valid custom object identifiers (container with key).A valid custom object draft is one which satisfies the following conditions:
- It is not null
- Specified by:
validateAndCollectReferencedKeys
in classBaseBatchValidator<com.commercetools.api.models.custom_object.CustomObjectDraft,CustomObjectSyncOptions,CustomObjectSyncStatistics>
- Parameters:
customObjectDrafts
- the custom object drafts to validate and collect valid custom object identifiers.- Returns:
ImmutablePair
<Set
<CustomObjectDraft
>,Set
<CustomObjectCompositeIdentifier
>> which contains theSet
of valid drafts and valid custom object identifiers (container with key).
-
-