Class 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<io.sphere.sdk.models.AssetDraft> mapToAssetDrafts​(java.util.List<io.sphere.sdk.models.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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • mapToAssetDrafts

        @Nonnull
        public static java.util.List<io.sphere.sdk.models.AssetDraft> mapToAssetDrafts​(@Nonnull
                                                                                       java.util.List<io.sphere.sdk.models.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 a List of AssetDraft 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 of AssetDraft that has all channel references with keys.