Class TaxCategoryBatchValidator
- java.lang.Object
-
- com.commercetools.sync.commons.helpers.BaseBatchValidator<com.commercetools.api.models.tax_category.TaxCategoryDraft,TaxCategorySyncOptions,TaxCategorySyncStatistics>
-
- com.commercetools.sync.taxcategories.helpers.TaxCategoryBatchValidator
-
public class TaxCategoryBatchValidator extends BaseBatchValidator<com.commercetools.api.models.tax_category.TaxCategoryDraft,TaxCategorySyncOptions,TaxCategorySyncStatistics>
-
-
Constructor Summary
Constructors Constructor Description TaxCategoryBatchValidator(TaxCategorySyncOptions syncOptions, TaxCategorySyncStatistics syncStatistics)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.commons.lang3.tuple.ImmutablePair<java.util.Set<com.commercetools.api.models.tax_category.TaxCategoryDraft>,java.util.Set<java.lang.String>>
validateAndCollectReferencedKeys(java.util.List<com.commercetools.api.models.tax_category.TaxCategoryDraft> taxCategoryDrafts)
Given theList
<TaxCategoryDraft
> of drafts this method attempts to validate drafts and return anImmutablePair
<Set
<TaxCategoryDraft
>,Set
<String
>> which contains theSet
of valid drafts and valid tax category keys.-
Methods inherited from class com.commercetools.sync.commons.helpers.BaseBatchValidator
collectReferencedKeyFromCustomFieldsDraft, collectReferencedKeyFromResourceIdentifier, collectReferencedKeysFromAssetDrafts, handleError, handleError
-
-
-
-
Constructor Detail
-
TaxCategoryBatchValidator
public TaxCategoryBatchValidator(@Nonnull TaxCategorySyncOptions syncOptions, @Nonnull TaxCategorySyncStatistics syncStatistics)
-
-
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 theList
<TaxCategoryDraft
> of drafts this method attempts to validate drafts and return anImmutablePair
<Set
<TaxCategoryDraft
>,Set
<String
>> which contains theSet
of valid drafts and valid tax category keys.A valid tax category draft is one which satisfies the following conditions:
- It is not null
- It has a key which is not blank (null/empty)
- Tax rates have not duplicated country and state.
- Specified by:
validateAndCollectReferencedKeys
in classBaseBatchValidator<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 theSet
of valid drafts and valid tax category keys.
-
-