public class ProductTypeTransformServiceImpl extends BaseTransformServiceImpl implements ProductTypeTransformService
CHUNK_SIZE, KEY_IS_NOT_SET_PLACE_HOLDER, referenceIdToKeyCache| Constructor and Description |
|---|
ProductTypeTransformServiceImpl(io.sphere.sdk.client.SphereClient ctpClient,
ReferenceIdToKeyCache referenceIdToKeyCache) |
| Modifier and Type | Method and Description |
|---|---|
java.util.concurrent.CompletableFuture<java.util.List<io.sphere.sdk.producttypes.ProductTypeDraft>> |
toProductTypeDrafts(java.util.List<io.sphere.sdk.producttypes.ProductType> productTypes)
Transforms productTypes by resolving the references and map them to ProductTypeDrafts.
|
cacheResourceReferenceKeys, cacheResourceReferenceKeys, createResourceIdsGraphQlRequests, fetchAndFillReferenceIdToKeyCache, getCtpClient, getNonCachedReferenceIdspublic ProductTypeTransformServiceImpl(@Nonnull
io.sphere.sdk.client.SphereClient ctpClient,
@Nonnull
ReferenceIdToKeyCache referenceIdToKeyCache)
@Nonnull
public java.util.concurrent.CompletableFuture<java.util.List<io.sphere.sdk.producttypes.ProductTypeDraft>> toProductTypeDrafts(@Nonnull
java.util.List<io.sphere.sdk.producttypes.ProductType> productTypes)
throws ReferenceReplacementException
ProductTypeTransformServiceThis method replaces the ids on attribute references with keys. It resolves(fetch key value
for the reference id) the non-null unexpanded references in the productTypeProductType
by using a 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 and store in the cache.
Then maps the ProductType to ProductTypeDraft by performing reference resolution considering idToKey value from the cache.
toProductTypeDrafts in interface ProductTypeTransformServiceproductTypes - the productTypes to replace the references and attributes ids with keys.ReferenceReplacementException