Class ProductTypeReferenceResolver
- java.lang.Object
-
- com.commercetools.sync.commons.helpers.BaseReferenceResolver<io.sphere.sdk.producttypes.ProductTypeDraft,ProductTypeSyncOptions>
-
- com.commercetools.sync.producttypes.helpers.ProductTypeReferenceResolver
-
public final class ProductTypeReferenceResolver extends BaseReferenceResolver<io.sphere.sdk.producttypes.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 aProductTypeSyncOptionsinstance and aProductTypeServiceto instantiate aAttributeDefinitionReferenceResolverinstance 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<io.sphere.sdk.producttypes.ProductTypeDraft>resolveReferences(io.sphere.sdk.producttypes.ProductTypeDraft productTypeDraft)Given aProductTypeDraftthis method attempts to resolve the attribute definition references to return aCompletionStagewhich 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 aProductTypeSyncOptionsinstance and aProductTypeServiceto instantiate aAttributeDefinitionReferenceResolverinstance 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<io.sphere.sdk.producttypes.ProductTypeDraft> resolveReferences(@Nonnull io.sphere.sdk.producttypes.ProductTypeDraft productTypeDraft)Given aProductTypeDraftthis method attempts to resolve the attribute definition references to return aCompletionStagewhich contains a new instance of the draft with the resolved references.- Specified by:
resolveReferencesin classBaseReferenceResolver<io.sphere.sdk.producttypes.ProductTypeDraft,ProductTypeSyncOptions>- Parameters:
productTypeDraft- the productTypeDraft to resolve its references.- Returns:
- a
CompletionStagethat contains as a result a new productTypeDraft instance with resolved references or, in case an error occurs during reference resolution, aReferenceResolutionException.
-
-