public class ProductTypeBatchValidator extends BaseBatchValidator<io.sphere.sdk.producttypes.ProductTypeDraft,ProductTypeSyncOptions,ProductTypeSyncStatistics>
Constructor and Description |
---|
ProductTypeBatchValidator(ProductTypeSyncOptions syncOptions,
ProductTypeSyncStatistics syncStatistics) |
Modifier and Type | Method and Description |
---|---|
static java.util.Optional<java.lang.String> |
getProductTypeKey(io.sphere.sdk.products.attributes.AttributeType attributeType)
This method is meant be only used internally by the library.
|
org.apache.commons.lang3.tuple.ImmutablePair<java.util.Set<io.sphere.sdk.producttypes.ProductTypeDraft>,java.util.Set<java.lang.String>> |
validateAndCollectReferencedKeys(java.util.List<io.sphere.sdk.producttypes.ProductTypeDraft> productTypeDrafts)
Given the
List <ProductTypeDraft > of drafts this method attempts to
validate drafts and collect referenced keys from the draft and return an ImmutablePair <Set <ProductTypeDraft > ,Set <String >> which contains the Set of valid drafts and referenced product type
keys. |
collectReferencedKeyFromCustomFieldsDraft, collectReferencedKeyFromReference, collectReferencedKeyFromResourceIdentifier, collectReferencedKeysFromAssetDrafts, handleError, handleError
public ProductTypeBatchValidator(@Nonnull ProductTypeSyncOptions syncOptions, @Nonnull ProductTypeSyncStatistics syncStatistics)
public org.apache.commons.lang3.tuple.ImmutablePair<java.util.Set<io.sphere.sdk.producttypes.ProductTypeDraft>,java.util.Set<java.lang.String>> validateAndCollectReferencedKeys(@Nonnull java.util.List<io.sphere.sdk.producttypes.ProductTypeDraft> productTypeDrafts)
List
<ProductTypeDraft
> of drafts this method attempts to
validate drafts and collect referenced keys from the draft and return an ImmutablePair
<Set
<ProductTypeDraft
> ,Set
<String
>> which contains the Set
of valid drafts and referenced product type
keys.
A valid productType draft is one which satisfies the following conditions:
validateAndCollectReferencedKeys
in class BaseBatchValidator<io.sphere.sdk.producttypes.ProductTypeDraft,ProductTypeSyncOptions,ProductTypeSyncStatistics>
productTypeDrafts
- the product type drafts to validate and collect referenced product
type keys.ImmutablePair
<Set
<ProductTypeDraft
>, Set
<String
>> which contains the Set
of valid drafts and
referenced product type keys.@Nonnull public static java.util.Optional<java.lang.String> getProductTypeKey(@Nonnull io.sphere.sdk.products.attributes.AttributeType attributeType) throws InvalidReferenceException
attributeType
- the attributeType to attempt to fetch the product type key of, if it
contains a nestedType reference.InvalidReferenceException
- thrown if the productType key in the nested reference is
invalid.