Class CategoryBatchValidator
- java.lang.Object
-
- com.commercetools.sync.commons.helpers.BaseBatchValidator<io.sphere.sdk.categories.CategoryDraft,CategorySyncOptions,CategorySyncStatistics>
-
- com.commercetools.sync.categories.helpers.CategoryBatchValidator
-
public class CategoryBatchValidator extends BaseBatchValidator<io.sphere.sdk.categories.CategoryDraft,CategorySyncOptions,CategorySyncStatistics>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CategoryBatchValidator.ReferencedKeys
-
Constructor Summary
Constructors Constructor Description CategoryBatchValidator(CategorySyncOptions syncOptions, CategorySyncStatistics 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.categories.CategoryDraft>,CategoryBatchValidator.ReferencedKeys>
validateAndCollectReferencedKeys(java.util.List<io.sphere.sdk.categories.CategoryDraft> categoryDrafts)
Given theList
<CategoryDraft
> of drafts this method attempts to validate drafts and collect referenced keys from the draft and return anImmutablePair
<Set
<CategoryDraft
>,CategoryBatchValidator.ReferencedKeys
> which contains theSet
of valid drafts and referenced keys within a wrapper.-
Methods inherited from class com.commercetools.sync.commons.helpers.BaseBatchValidator
collectReferencedKeyFromCustomFieldsDraft, collectReferencedKeyFromReference, collectReferencedKeyFromResourceIdentifier, collectReferencedKeysFromAssetDrafts, handleError, handleError
-
-
-
-
Constructor Detail
-
CategoryBatchValidator
public CategoryBatchValidator(@Nonnull CategorySyncOptions syncOptions, @Nonnull CategorySyncStatistics syncStatistics)
-
-
Method Detail
-
validateAndCollectReferencedKeys
public org.apache.commons.lang3.tuple.ImmutablePair<java.util.Set<io.sphere.sdk.categories.CategoryDraft>,CategoryBatchValidator.ReferencedKeys> validateAndCollectReferencedKeys(@Nonnull java.util.List<io.sphere.sdk.categories.CategoryDraft> categoryDrafts)
Given theList
<CategoryDraft
> of drafts this method attempts to validate drafts and collect referenced keys from the draft and return anImmutablePair
<Set
<CategoryDraft
>,CategoryBatchValidator.ReferencedKeys
> which contains theSet
of valid drafts and referenced keys within a wrapper.A valid category draft is one which satisfies the following conditions:
- It is not null
- It has a key which is not blank (null/empty)
- Specified by:
validateAndCollectReferencedKeys
in classBaseBatchValidator<io.sphere.sdk.categories.CategoryDraft,CategorySyncOptions,CategorySyncStatistics>
- Parameters:
categoryDrafts
- the category drafts to validate and collect referenced keys.- Returns:
ImmutablePair
<Set
<CategoryDraft
>,CategoryBatchValidator.ReferencedKeys
> which contains theSet
of valid drafts and referenced keys within a wrapper.
-
-