public interface ProductTransformService
Modifier and Type | Method and Description |
---|---|
java.util.concurrent.CompletableFuture<java.util.List<io.sphere.sdk.products.ProductDraft>> |
toProductDrafts(java.util.List<io.sphere.sdk.products.ProductProjection> products)
Transforms products by resolving the references and map them to ProductDrafts.
|
@Nonnull java.util.concurrent.CompletableFuture<java.util.List<io.sphere.sdk.products.ProductDraft>> toProductDrafts(@Nonnull java.util.List<io.sphere.sdk.products.ProductProjection> products)
This method replaces the ids on attribute references with keys and resolves(fetch key values
for the reference id's) non null and unexpanded references of the productProduct
by
using cache.
If the reference ids are already cached, key values are pulled from the cache, otherwise it executes the query to fetch the key value for the reference id's and store the idToKey value pair in the cache for reuse.
Then maps the Product to ProductDraft by performing reference resolution considering idToKey value from the cache.
products
- the products to replace the references and attributes id's with keys.