public interface CategoryTransformService
Modifier and Type | Method and Description |
---|---|
java.util.concurrent.CompletableFuture<java.util.List<io.sphere.sdk.categories.CategoryDraft>> |
toCategoryDrafts(java.util.List<io.sphere.sdk.categories.Category> categories)
Transforms categories by resolving the references and map them to CategoryDrafts.
|
@Nonnull java.util.concurrent.CompletableFuture<java.util.List<io.sphere.sdk.categories.CategoryDraft>> toCategoryDrafts(@Nonnull java.util.List<io.sphere.sdk.categories.Category> categories)
This method replaces the ids on unexpanded references of the categoryCategory
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 Category to CategoryDraft by performing reference resolution considering idToKey value from the cache.
categories
- the categories to replace the references id's with keys.