Class ProductTypeReferenceResolutionUtils
- java.lang.Object
-
- com.commercetools.sync.producttypes.utils.ProductTypeReferenceResolutionUtils
-
public final class ProductTypeReferenceResolutionUtils extends java.lang.ObjectUtil 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.producttypes.ProductTypeDraft>mapToProductTypeDrafts(java.util.List<io.sphere.sdk.producttypes.ProductType> productTypes, ReferenceIdToKeyCache referenceIdToKeyCache)Returns anList<ProductTypeDraft> consisting of the results of applying the mapping fromProductTypetoProductTypeDraftwith considering reference resolution.
-
-
-
Method Detail
-
mapToProductTypeDrafts
@Nonnull public static java.util.List<io.sphere.sdk.producttypes.ProductTypeDraft> mapToProductTypeDrafts(@Nonnull java.util.List<io.sphere.sdk.producttypes.ProductType> productTypes, @Nonnull ReferenceIdToKeyCache referenceIdToKeyCache)Returns anList<ProductTypeDraft> consisting of the results of applying the mapping fromProductTypetoProductTypeDraftwith considering reference resolution.Mapping of Reference fields for the reference resolution Reference field from to productType references (in case it has NestedType or set of NestedType) Set<Reference<ProductType>>Set<Reference<ProductType>> (with key replaced with id field)Note:If some references are not expanded for an attributeDefinition of a productType, the method will throw a
ReferenceReplacementExceptioncontaining the root causes of the exceptions that occurred in any of the suppliedproductTypes.- Parameters:
productTypes- the product types with expanded references.referenceIdToKeyCache- the instance that manages cache.- Returns:
- a
ListofProductTypeDraftbuilt from the suppliedListofProductType.
-
-