Class CartDiscountBatchValidator
- java.lang.Object
 - 
- com.commercetools.sync.commons.helpers.BaseBatchValidator<io.sphere.sdk.cartdiscounts.CartDiscountDraft,CartDiscountSyncOptions,CartDiscountSyncStatistics>
 - 
- com.commercetools.sync.cartdiscounts.helpers.CartDiscountBatchValidator
 
 
 
- 
public class CartDiscountBatchValidator extends BaseBatchValidator<io.sphere.sdk.cartdiscounts.CartDiscountDraft,CartDiscountSyncOptions,CartDiscountSyncStatistics>
 
- 
- 
Constructor Summary
Constructors Constructor Description CartDiscountBatchValidator(CartDiscountSyncOptions syncOptions, CartDiscountSyncStatistics 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.cartdiscounts.CartDiscountDraft>,java.util.Set<java.lang.String>>validateAndCollectReferencedKeys(java.util.List<io.sphere.sdk.cartdiscounts.CartDiscountDraft> cartDiscountDrafts)Given theList<CartDiscountDraft> of drafts this method attempts to validate drafts and collect referenced type keys from the draft and return anImmutablePair<Set<CartDiscountDraft> ,Set<String>> which contains theSetof valid drafts and referenced type keys.- 
Methods inherited from class com.commercetools.sync.commons.helpers.BaseBatchValidator
collectReferencedKeyFromCustomFieldsDraft, collectReferencedKeyFromReference, collectReferencedKeyFromResourceIdentifier, collectReferencedKeysFromAssetDrafts, handleError, handleError 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
CartDiscountBatchValidator
public CartDiscountBatchValidator(@Nonnull CartDiscountSyncOptions syncOptions, @Nonnull CartDiscountSyncStatistics syncStatistics) 
 - 
 
- 
Method Detail
- 
validateAndCollectReferencedKeys
public org.apache.commons.lang3.tuple.ImmutablePair<java.util.Set<io.sphere.sdk.cartdiscounts.CartDiscountDraft>,java.util.Set<java.lang.String>> validateAndCollectReferencedKeys(@Nonnull java.util.List<io.sphere.sdk.cartdiscounts.CartDiscountDraft> cartDiscountDrafts)Given theList<CartDiscountDraft> of drafts this method attempts to validate drafts and collect referenced type keys from the draft and return anImmutablePair<Set<CartDiscountDraft> ,Set<String>> which contains theSetof valid drafts and referenced type keys.A valid cart discount draft is one which satisfies the following conditions:
- It is not null
 - It has a key which is not blank (null/empty)
 
- Specified by:
 validateAndCollectReferencedKeysin classBaseBatchValidator<io.sphere.sdk.cartdiscounts.CartDiscountDraft,CartDiscountSyncOptions,CartDiscountSyncStatistics>- Parameters:
 cartDiscountDrafts- the cart discount drafts to validate and collect referenced type keys.- Returns:
 ImmutablePair<Set<ProductTypeDraft>,Set<String>> which contains theSetof valid drafts and referenced type keys.
 
 - 
 
 -