Class CategoryBatchValidator

    • Field Detail

      • CATEGORY_DRAFT_KEY_NOT_SET

        public static final java.lang.String CATEGORY_DRAFT_KEY_NOT_SET
        See Also:
        Constant Field Values
    • Method Detail

      • validateAndCollectReferencedKeys

        public org.apache.commons.lang3.tuple.ImmutablePair<java.util.Set<com.commercetools.api.models.category.CategoryDraft>,​CategoryBatchValidator.ReferencedKeys> validateAndCollectReferencedKeys​(@Nonnull
                                                                                                                                                                                                             java.util.List<com.commercetools.api.models.category.CategoryDraft> categoryDrafts)
        Given the List<CategoryDraft> of drafts this method attempts to validate drafts and collect referenced keys from the draft and return an ImmutablePair<Set<CategoryDraft>,CategoryBatchValidator.ReferencedKeys> which contains the Set of valid drafts and referenced keys within a wrapper.

        A valid category draft is one which satisfies the following conditions:

        1. It is not null
        2. It has a key which is not blank (null/empty)
        Specified by:
        validateAndCollectReferencedKeys in class BaseBatchValidator<com.commercetools.api.models.category.CategoryDraft,​CategorySyncOptions,​CategorySyncStatistics>
        Parameters:
        categoryDrafts - the category drafts to validate and collect referenced keys.
        Returns:
        ImmutablePair<Set<CategoryDraft>,CategoryBatchValidator.ReferencedKeys> which contains the Set of valid drafts and referenced keys within a wrapper.