public final class ProductReferenceReplacementUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static io.sphere.sdk.products.queries.ProductQuery |
buildProductQuery()
Builds a
ProductQuery for fetching products from a source CTP project with all the needed references
expanded for the sync:
Product Type
Tax Category
Product State
Staged Assets' Custom Types
Staged Product Categories
Staged Prices' Channels
Staged Prices' Custom Types
Reference Attributes
Reference Set Attributes
|
static io.sphere.sdk.products.ProductDraftBuilder |
getDraftBuilderFromStagedProduct(io.sphere.sdk.products.Product product)
Given a
Product this method creates a ProductDraftBuilder based on the staged projection
values of the supplied product. |
static java.util.List<io.sphere.sdk.products.ProductDraft> |
replaceProductsReferenceIdsWithKeys(java.util.List<io.sphere.sdk.products.Product> products)
Takes a list of Products that are supposed to have their product type, tax category, state, variants and category
references expanded in order to be able to fetch the keys and replace the reference ids with the corresponding
keys and then return a new list of product drafts with their references containing keys instead of the ids.
|
@Nonnull
public static java.util.List<io.sphere.sdk.products.ProductDraft> replaceProductsReferenceIdsWithKeys(@Nonnull
java.util.List<io.sphere.sdk.products.Product> products)
Note:If the references are not expanded for a product, the reference ids will not be replaced with keys and will still have their ids in place.
products - the products to replace their reference ids with keys@Nonnull
public static io.sphere.sdk.products.ProductDraftBuilder getDraftBuilderFromStagedProduct(@Nonnull
io.sphere.sdk.products.Product product)
Product this method creates a ProductDraftBuilder based on the staged projection
values of the supplied product.product - the product to create a ProductDraftBuilder based on it's staged data.ProductDraftBuilder based on the staged projection values of the supplied product.@Nonnull public static io.sphere.sdk.products.queries.ProductQuery buildProductQuery()
ProductQuery for fetching products from a source CTP project with all the needed references
expanded for the sync: