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 void
collectReferencedKeyFromCustomFieldsDraft(io.sphere.sdk.types.CustomFieldsDraft customFieldsDraft, java.util.function.Consumer<java.lang.String> keyConsumer)
protected <T> void
collectReferencedKeyFromReference(io.sphere.sdk.models.Reference<T> reference, java.util.function.Consumer<java.lang.String> keyInReferenceSupplier)
protected <T> void
collectReferencedKeyFromResourceIdentifier(io.sphere.sdk.models.ResourceIdentifier<T> resourceIdentifier, java.util.function.Consumer<java.lang.String> keyConsumer)
protected void
collectReferencedKeysFromAssetDrafts(java.util.List<io.sphere.sdk.models.AssetDraft> assetDrafts, java.util.function.Consumer<java.lang.String> keyConsumer)
protected void
handleError(SyncException syncException)
protected void
handleError(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 theSet
of 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 theSet
of valid drafts and referenced keys.- Parameters:
drafts
- the drafts to validate.- Returns:
ImmutablePair
<Set
<D
>, ?> which contains theSet
of 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)
-
-