Class ProductTypeReferenceResolver
- java.lang.Object
-
- com.commercetools.sync.commons.helpers.BaseReferenceResolver<com.commercetools.api.models.product_type.ProductTypeDraft,ProductTypeSyncOptions>
-
- com.commercetools.sync.producttypes.helpers.ProductTypeReferenceResolver
-
public final class ProductTypeReferenceResolver extends BaseReferenceResolver<com.commercetools.api.models.product_type.ProductTypeDraft,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 ProductTypeReferenceResolver(ProductTypeSyncOptions productTypeSyncOptions, ProductTypeService productTypeService)
Takes aProductTypeSyncOptions
instance and aProductTypeService
to instantiate aAttributeDefinitionReferenceResolver
instance that could be used to resolve the AttributeDefinition references on the productType draft supplied to theresolveReferences(ProductTypeDraft)
method.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.concurrent.CompletionStage<com.commercetools.api.models.product_type.ProductTypeDraft>
resolveReferences(com.commercetools.api.models.product_type.ProductTypeDraft productTypeDraft)
Given aProductTypeDraft
this method attempts to resolve the attribute definition references 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
-
ProductTypeReferenceResolver
public ProductTypeReferenceResolver(@Nonnull ProductTypeSyncOptions productTypeSyncOptions, @Nonnull ProductTypeService productTypeService)
Takes aProductTypeSyncOptions
instance and aProductTypeService
to instantiate aAttributeDefinitionReferenceResolver
instance that could be used to resolve the AttributeDefinition references on the productType draft supplied to theresolveReferences(ProductTypeDraft)
method.- Parameters:
productTypeSyncOptions
- the container of all the options of the sync process including the CTP project client and/or configuration and other sync-specific options.productTypeService
- the service to fetch the product type for reference resolution.
-
-
Method Detail
-
resolveReferences
@Nonnull public java.util.concurrent.CompletionStage<com.commercetools.api.models.product_type.ProductTypeDraft> resolveReferences(@Nonnull com.commercetools.api.models.product_type.ProductTypeDraft productTypeDraft)
Given aProductTypeDraft
this method attempts to resolve the attribute definition references 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.ProductTypeDraft,ProductTypeSyncOptions>
- Parameters:
productTypeDraft
- the productTypeDraft to resolve its references.- Returns:
- a
CompletionStage
that contains as a result a new productTypeDraft instance with resolved references or, in case an error occurs during reference resolution, aReferenceResolutionException
.
-
-