Class CustomObjectBatchValidator
- java.lang.Object
-
- com.commercetools.sync.commons.helpers.BaseBatchValidator<io.sphere.sdk.customobjects.CustomObjectDraft<com.fasterxml.jackson.databind.JsonNode>,CustomObjectSyncOptions,CustomObjectSyncStatistics>
-
- com.commercetools.sync.customobjects.helpers.CustomObjectBatchValidator
-
public class CustomObjectBatchValidator extends BaseBatchValidator<io.sphere.sdk.customobjects.CustomObjectDraft<com.fasterxml.jackson.databind.JsonNode>,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<io.sphere.sdk.customobjects.CustomObjectDraft<com.fasterxml.jackson.databind.JsonNode>>,java.util.Set<CustomObjectCompositeIdentifier>>
validateAndCollectReferencedKeys(java.util.List<io.sphere.sdk.customobjects.CustomObjectDraft<com.fasterxml.jackson.databind.JsonNode>> 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, collectReferencedKeyFromReference, 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<io.sphere.sdk.customobjects.CustomObjectDraft<com.fasterxml.jackson.databind.JsonNode>>,java.util.Set<CustomObjectCompositeIdentifier>> validateAndCollectReferencedKeys(@Nonnull java.util.List<io.sphere.sdk.customobjects.CustomObjectDraft<com.fasterxml.jackson.databind.JsonNode>> 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<io.sphere.sdk.customobjects.CustomObjectDraft<com.fasterxml.jackson.databind.JsonNode>,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).
-
-