public class ProductBatchProcessor
extends java.lang.Object
| Constructor and Description |
|---|
ProductBatchProcessor(java.util.List<io.sphere.sdk.products.ProductDraft> productDrafts,
ProductSync productSync) |
| Modifier and Type | Method and Description |
|---|---|
java.util.Set<java.lang.String> |
getKeysToCache() |
static java.util.Set<java.lang.String> |
getReferencedProductKeys(io.sphere.sdk.products.ProductVariantDraft variantDraft)
Get a set of referenced product keys on all attribute drafts on the supplied Product
Variant Draft.
|
java.util.Set<io.sphere.sdk.products.ProductDraft> |
getValidDrafts() |
void |
validateBatch()
This method validates the batch of drafts, and only for valid drafts it adds the valid draft
to
validDrafts set, and adds the keys of all referenced products to
keysToCache. |
public ProductBatchProcessor(@Nonnull
java.util.List<io.sphere.sdk.products.ProductDraft> productDrafts,
@Nonnull
ProductSync productSync)
public void validateBatch()
validDrafts set, and adds the keys of all referenced products to
keysToCache.
A valid product draft is one which satisfies the following conditions:
@Nonnull
public static java.util.Set<java.lang.String> getReferencedProductKeys(@Nonnull
io.sphere.sdk.products.ProductVariantDraft variantDraft)
Note: Null attributes are skipped since they are validated at a later stage in
(ProductVariantUpdateActionUtils)
variantDraft - the variant draft to get the referenced product keys from.public java.util.Set<io.sphere.sdk.products.ProductDraft> getValidDrafts()
public java.util.Set<java.lang.String> getKeysToCache()