Class TaxCategoryBatchValidator

    • Method Detail

      • validateAndCollectReferencedKeys

        public org.apache.commons.lang3.tuple.ImmutablePair<java.util.Set<io.sphere.sdk.taxcategories.TaxCategoryDraft>,​java.util.Set<java.lang.String>> validateAndCollectReferencedKeys​(@Nonnull
                                                                                                                                                                                                java.util.List<io.sphere.sdk.taxcategories.TaxCategoryDraft> taxCategoryDrafts)
        Given the List<TaxCategoryDraft> of drafts this method attempts to validate drafts and return an ImmutablePair<Set<TaxCategoryDraft>,Set< String>> which contains the Set of valid drafts and valid tax category keys.

        A valid tax 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)
        3. Tax rates have not duplicated country and state.
        Specified by:
        validateAndCollectReferencedKeys in class BaseBatchValidator<io.sphere.sdk.taxcategories.TaxCategoryDraft,​TaxCategorySyncOptions,​TaxCategorySyncStatistics>
        Parameters:
        taxCategoryDrafts - the tax category drafts to validate and collect valid tax category keys.
        Returns:
        ImmutablePair<Set<TaxCategoryDraft>, Set<String>> which contains the Set of valid drafts and valid tax category keys.