Class TaxCategoryBatchValidator

    • Method Detail

      • validateAndCollectReferencedKeys

        public org.apache.commons.lang3.tuple.ImmutablePair<java.util.Set<com.commercetools.api.models.tax_category.TaxCategoryDraft>,​java.util.Set<java.lang.String>> validateAndCollectReferencedKeys​(@Nonnull
                                                                                                                                                                                                              java.util.List<com.commercetools.api.models.tax_category.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<com.commercetools.api.models.tax_category.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.