Class AssetReferenceResolutionUtils
- java.lang.Object
-
- com.commercetools.sync.commons.utils.AssetReferenceResolutionUtils
-
public final class AssetReferenceResolutionUtils extends java.lang.Object
Util class which provides utilities that can be used when syncing resources from a source commercetools project to a target one.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.List<com.commercetools.api.models.common.AssetDraft>
mapToAssetDrafts(java.util.List<com.commercetools.api.models.common.Asset> assets, ReferenceIdToKeyCache referenceIdToKeyCache)
Takes an asset list that is supposed to have all its asset's custom references id's are cached in the map in order to be able to fetch the keys for the custom references.
-
-
-
Method Detail
-
mapToAssetDrafts
@Nonnull public static java.util.List<com.commercetools.api.models.common.AssetDraft> mapToAssetDrafts(@Nonnull java.util.List<com.commercetools.api.models.common.Asset> assets, @Nonnull ReferenceIdToKeyCache referenceIdToKeyCache)
Takes an asset list that is supposed to have all its asset's custom references id's are cached in the map in order to be able to fetch the keys for the custom references. This method returns as a result aList
ofAssetDraft
that has all custom references with keys.Any custom reference that is not in the map(cache) will have its id in place and not replaced by the key.
- Parameters:
assets
- the list of assets to replace their custom ids with keys.referenceIdToKeyCache
- the instance that manages cache.- Returns:
- a
List
ofAssetDraft
that has all channel references with keys.
-
-