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