public class ShoppingListTransformServiceImpl extends BaseTransformServiceImpl implements ShoppingListTransformService
CHUNK_SIZE, KEY_IS_NOT_SET_PLACE_HOLDER, referenceIdToKeyCache| Constructor and Description |
|---|
ShoppingListTransformServiceImpl(io.sphere.sdk.client.SphereClient ctpClient,
ReferenceIdToKeyCache referenceIdToKeyCache) |
| Modifier and Type | Method and Description |
|---|---|
java.util.concurrent.CompletableFuture<java.util.List<io.sphere.sdk.shoppinglists.ShoppingListDraft>> |
toShoppingListDrafts(java.util.List<io.sphere.sdk.shoppinglists.ShoppingList> shoppingLists)
Transforms ShoppingLists by resolving the references and map them to ShoppingListDrafts.
|
cacheResourceReferenceKeys, cacheResourceReferenceKeys, createResourceIdsGraphQlRequests, fetchAndFillReferenceIdToKeyCache, getCtpClient, getNonCachedReferenceIdspublic ShoppingListTransformServiceImpl(@Nonnull
io.sphere.sdk.client.SphereClient ctpClient,
@Nonnull
ReferenceIdToKeyCache referenceIdToKeyCache)
@Nonnull
public java.util.concurrent.CompletableFuture<java.util.List<io.sphere.sdk.shoppinglists.ShoppingListDraft>> toShoppingListDrafts(@Nonnull
java.util.List<io.sphere.sdk.shoppinglists.ShoppingList> shoppingLists)
ShoppingListTransformServiceThis method resolves(fetch key values for the reference id's) non null and unexpanded
references of the ShoppingListShoppingList 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 ShoppingList to ShoppingListDraft by performing reference resolution considering idToKey value from the cache.
toShoppingListDrafts in interface ShoppingListTransformServiceshoppingLists - the shoppingLists to resolve the references.