Class AttributeDefinitionReferenceResolver
- java.lang.Object
-
- com.commercetools.sync.commons.helpers.BaseReferenceResolver<com.commercetools.api.models.product_type.AttributeDefinitionDraft,ProductTypeSyncOptions>
-
- com.commercetools.sync.producttypes.helpers.AttributeDefinitionReferenceResolver
-
public class AttributeDefinitionReferenceResolver extends BaseReferenceResolver<com.commercetools.api.models.product_type.AttributeDefinitionDraft,ProductTypeSyncOptions>
-
-
Field Summary
-
Fields inherited from class com.commercetools.sync.commons.helpers.BaseReferenceResolver
BLANK_ID_VALUE_ON_REFERENCE, BLANK_KEY_VALUE_ON_RESOURCE_IDENTIFIER, options
-
-
Constructor Summary
Constructors Constructor Description AttributeDefinitionReferenceResolver(ProductTypeSyncOptions options, ProductTypeService productTypeService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.concurrent.CompletionStage<com.commercetools.api.models.product_type.AttributeDefinitionDraft>
resolveReferences(com.commercetools.api.models.product_type.AttributeDefinitionDraft attributeDefinitionDraft)
Given anAttributeDefinitionDraft
this method attempts to resolve the ProductType references, which can exist on attributeDefinition with an AttributeType: NestedType or SetType of NestedType, to return aCompletionStage
which contains a new instance of the draft with the resolved references.-
Methods inherited from class com.commercetools.sync.commons.helpers.BaseReferenceResolver
getIdFromReference, getKeyFromResourceIdentifier
-
-
-
-
Constructor Detail
-
AttributeDefinitionReferenceResolver
public AttributeDefinitionReferenceResolver(@Nonnull ProductTypeSyncOptions options, @Nonnull ProductTypeService productTypeService)
-
-
Method Detail
-
resolveReferences
@Nonnull public java.util.concurrent.CompletionStage<com.commercetools.api.models.product_type.AttributeDefinitionDraft> resolveReferences(@Nonnull com.commercetools.api.models.product_type.AttributeDefinitionDraft attributeDefinitionDraft)
Given anAttributeDefinitionDraft
this method attempts to resolve the ProductType references, which can exist on attributeDefinition with an AttributeType: NestedType or SetType of NestedType, to return aCompletionStage
which contains a new instance of the draft with the resolved references.- Specified by:
resolveReferences
in classBaseReferenceResolver<com.commercetools.api.models.product_type.AttributeDefinitionDraft,ProductTypeSyncOptions>
- Parameters:
attributeDefinitionDraft
- the attributeDefinitionDraft to resolve its references.- Returns:
- a
CompletionStage
that contains as a result a new attributeDefinitionDraft instance with resolved references or if there is no productType existing with the given key the draft will be returned as is without the reference resolved. In case an error occurs during reference resolution, aReferenceResolutionException
is thrown.
-
-