Class BaseBatchValidator<D,O extends BaseSyncOptions,S extends BaseSyncStatistics>
- java.lang.Object
 - 
- com.commercetools.sync.commons.helpers.BaseBatchValidator<D,O,S>
 
 
- 
- Direct Known Subclasses:
 CartDiscountBatchValidator,CategoryBatchValidator,CustomerBatchValidator,CustomObjectBatchValidator,InventoryBatchValidator,ProductBatchValidator,ProductTypeBatchValidator,ShoppingListBatchValidator,StateBatchValidator,TaxCategoryBatchValidator,TypeBatchValidator
public abstract class BaseBatchValidator<D,O extends BaseSyncOptions,S extends BaseSyncStatistics> extends java.lang.Object 
- 
- 
Constructor Summary
Constructors Constructor Description BaseBatchValidator(O syncOptions, S syncStatistics) 
- 
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidcollectReferencedKeyFromCustomFieldsDraft(io.sphere.sdk.types.CustomFieldsDraft customFieldsDraft, java.util.function.Consumer<java.lang.String> keyConsumer)protected <T> voidcollectReferencedKeyFromReference(io.sphere.sdk.models.Reference<T> reference, java.util.function.Consumer<java.lang.String> keyInReferenceSupplier)protected <T> voidcollectReferencedKeyFromResourceIdentifier(io.sphere.sdk.models.ResourceIdentifier<T> resourceIdentifier, java.util.function.Consumer<java.lang.String> keyConsumer)protected voidcollectReferencedKeysFromAssetDrafts(java.util.List<io.sphere.sdk.models.AssetDraft> assetDrafts, java.util.function.Consumer<java.lang.String> keyConsumer)protected voidhandleError(SyncException syncException)protected voidhandleError(java.lang.String errorMessage)abstract org.apache.commons.lang3.tuple.ImmutablePair<java.util.Set<D>,?>validateAndCollectReferencedKeys(java.util.List<D> drafts)Given theList<D> (e.g.CategoryDraft) of drafts this method attempts to validate drafts and collect referenced keys from the draft and return anImmutablePair<Set<D>, ?> which contains theSetof valid drafts and referenced keys. 
 - 
 
- 
- 
Method Detail
- 
validateAndCollectReferencedKeys
public abstract org.apache.commons.lang3.tuple.ImmutablePair<java.util.Set<D>,?> validateAndCollectReferencedKeys(@Nonnull java.util.List<D> drafts)
Given theList<D> (e.g.CategoryDraft) of drafts this method attempts to validate drafts and collect referenced keys from the draft and return anImmutablePair<Set<D>, ?> which contains theSetof valid drafts and referenced keys.- Parameters:
 drafts- the drafts to validate.- Returns:
 ImmutablePair<Set<D>, ?> which contains theSetof valid drafts and referenced keys.
 
- 
collectReferencedKeyFromResourceIdentifier
protected <T> void collectReferencedKeyFromResourceIdentifier(@Nullable io.sphere.sdk.models.ResourceIdentifier<T> resourceIdentifier, @Nonnull java.util.function.Consumer<java.lang.String> keyConsumer) 
- 
collectReferencedKeyFromCustomFieldsDraft
protected void collectReferencedKeyFromCustomFieldsDraft(@Nullable io.sphere.sdk.types.CustomFieldsDraft customFieldsDraft, @Nonnull java.util.function.Consumer<java.lang.String> keyConsumer) 
- 
collectReferencedKeysFromAssetDrafts
protected void collectReferencedKeysFromAssetDrafts(@Nullable java.util.List<io.sphere.sdk.models.AssetDraft> assetDrafts, @Nonnull java.util.function.Consumer<java.lang.String> keyConsumer) 
- 
collectReferencedKeyFromReference
protected <T> void collectReferencedKeyFromReference(@Nullable io.sphere.sdk.models.Reference<T> reference, @Nonnull java.util.function.Consumer<java.lang.String> keyInReferenceSupplier) 
- 
handleError
protected void handleError(@Nonnull SyncException syncException) 
- 
handleError
protected void handleError(@Nonnull java.lang.String errorMessage) 
 - 
 
 -