public final class ProductReferenceResolver extends BaseReferenceResolver<io.sphere.sdk.products.ProductDraft,ProductSyncOptions>
BLANK_ID_VALUE_ON_RESOURCE_IDENTIFIER, options| Constructor and Description |
|---|
ProductReferenceResolver(ProductSyncOptions productSyncOptions,
ProductTypeService productTypeService,
CategoryService categoryService,
TypeService typeService,
ChannelService channelService,
CustomerGroupService customerGroupService,
TaxCategoryService taxCategoryService,
StateService stateService,
ProductService productService)
Takes a
ProductSyncOptions instance, a ProductTypeService, a CategoryService, a
TypeService, a ChannelService, a CustomerGroupService, a TaxCategoryService,
a StateService and a ProductService to instantiate a ProductReferenceResolver instance
that could be used to resolve the product type, categories, variants, tax category and product state references
of product drafts in the CTP project specified in the injected ProductSyncOptions instance. |
| Modifier and Type | Method and Description |
|---|---|
java.util.concurrent.CompletionStage<io.sphere.sdk.products.ProductDraftBuilder> |
resolveCategoryReferences(io.sphere.sdk.products.ProductDraftBuilder draftBuilder)
Given a
ProductDraftBuilder this method attempts to resolve the categories and categoryOrderHints to
return a CompletionStage which contains a new instance of the builder with the resolved references. |
java.util.concurrent.CompletionStage<io.sphere.sdk.products.ProductDraftBuilder> |
resolveProductTypeReference(io.sphere.sdk.products.ProductDraftBuilder draftBuilder)
Given a
ProductDraftBuilder this method attempts to resolve the product type to return a
CompletionStage which contains a new instance of the builder with the resolved product type reference. |
java.util.concurrent.CompletionStage<io.sphere.sdk.products.ProductDraft> |
resolveReferences(io.sphere.sdk.products.ProductDraft productDraft)
Given a
ProductDraft this method attempts to resolve the product type, categories, variants, tax
category and product state references to return a CompletionStage which contains a new instance of the
draft with the resolved references. |
java.util.concurrent.CompletionStage<io.sphere.sdk.products.ProductDraftBuilder> |
resolveStateReference(io.sphere.sdk.products.ProductDraftBuilder draftBuilder)
Given a
ProductDraftBuilder this method attempts to resolve the state to return a CompletionStage
which contains a new instance of the builder with the resolved state reference. |
java.util.concurrent.CompletionStage<io.sphere.sdk.products.ProductDraftBuilder> |
resolveTaxCategoryReference(io.sphere.sdk.products.ProductDraftBuilder draftBuilder)
Given a
ProductDraftBuilder this method attempts to resolve the tax category to return a
CompletionStage which contains a new instance of the builder with the resolved tax category reference. |
getKeyFromResourceIdentifierpublic ProductReferenceResolver(@Nonnull
ProductSyncOptions productSyncOptions,
@Nonnull
ProductTypeService productTypeService,
@Nonnull
CategoryService categoryService,
@Nonnull
TypeService typeService,
@Nonnull
ChannelService channelService,
@Nonnull
CustomerGroupService customerGroupService,
@Nonnull
TaxCategoryService taxCategoryService,
@Nonnull
StateService stateService,
@Nonnull
ProductService productService)
ProductSyncOptions instance, a ProductTypeService, a CategoryService, a
TypeService, a ChannelService, a CustomerGroupService, a TaxCategoryService,
a StateService and a ProductService to instantiate a ProductReferenceResolver instance
that could be used to resolve the product type, categories, variants, tax category and product state references
of product drafts in the CTP project specified in the injected ProductSyncOptions instance.productSyncOptions - 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.categoryService - the service to fetch the categories for reference resolution.typeService - the service to fetch the custom types for reference resolution.channelService - the service to fetch the channels for reference resolution.customerGroupService - the service to fetch the customer groups for reference resolution.taxCategoryService - the service to fetch tax categories for reference resolution.stateService - the service to fetch product states for reference resolution.productService - the service to fetch products for product reference resolution on reference
attributes.public java.util.concurrent.CompletionStage<io.sphere.sdk.products.ProductDraft> resolveReferences(@Nonnull
io.sphere.sdk.products.ProductDraft productDraft)
ProductDraft this method attempts to resolve the product type, categories, variants, tax
category and product state references to return a CompletionStage which contains a new instance of the
draft with the resolved references. The keys of the references are either taken from the expanded references or
taken from the id field of the references.resolveReferences in class BaseReferenceResolver<io.sphere.sdk.products.ProductDraft,ProductSyncOptions>productDraft - the productDraft to resolve it's references.CompletionStage that contains as a result a new productDraft instance with resolved references
or, in case an error occurs during reference resolution, a ReferenceResolutionException.@Nonnull
public java.util.concurrent.CompletionStage<io.sphere.sdk.products.ProductDraftBuilder> resolveProductTypeReference(@Nonnull
io.sphere.sdk.products.ProductDraftBuilder draftBuilder)
ProductDraftBuilder this method attempts to resolve the product type to return a
CompletionStage which contains a new instance of the builder with the resolved product type reference.
The key of the product type reference is either taken from the expanded reference or taken from the value of the
id field.draftBuilder - the productDraft to resolve its product type reference.CompletionStage that contains as a result a new builder instance with resolved product type
reference or, in case an error occurs during reference resolution,
a ReferenceResolutionException.@Nonnull
public java.util.concurrent.CompletionStage<io.sphere.sdk.products.ProductDraftBuilder> resolveCategoryReferences(@Nonnull
io.sphere.sdk.products.ProductDraftBuilder draftBuilder)
ProductDraftBuilder this method attempts to resolve the categories and categoryOrderHints to
return a CompletionStage which contains a new instance of the builder with the resolved references.
The key of the category references is either taken from the expanded references or taken from the value of the
id fields.draftBuilder - the productDraft to resolve its category and categoryOrderHints references.CompletionStage that contains as a result a new builder instance with resolved references or,
in case an error occurs during reference resolution, a ReferenceResolutionException.@Nonnull
public java.util.concurrent.CompletionStage<io.sphere.sdk.products.ProductDraftBuilder> resolveTaxCategoryReference(@Nonnull
io.sphere.sdk.products.ProductDraftBuilder draftBuilder)
ProductDraftBuilder this method attempts to resolve the tax category to return a
CompletionStage which contains a new instance of the builder with the resolved tax category reference.
The key of the tax category reference is either taken from the expanded reference or taken from the value of the
id field.draftBuilder - the productDraft to resolve its tax category reference.CompletionStage that contains as a result a new builder instance with resolved tax category
reference or, in case an error occurs during reference resolution,
a ReferenceResolutionException.@Nonnull
public java.util.concurrent.CompletionStage<io.sphere.sdk.products.ProductDraftBuilder> resolveStateReference(@Nonnull
io.sphere.sdk.products.ProductDraftBuilder draftBuilder)
ProductDraftBuilder this method attempts to resolve the state to return a CompletionStage
which contains a new instance of the builder with the resolved state reference. The key of the state reference is
either taken from the expanded reference or taken from the value of the id field.draftBuilder - the productDraft to resolve its state reference.CompletionStage that contains as a result a new builder instance with resolved state
reference or, in case an error occurs during reference resolution,
a ReferenceResolutionException.