Class ProductTypeReferenceResolutionUtils
- java.lang.Object
-
- com.commercetools.sync.producttypes.utils.ProductTypeReferenceResolutionUtils
-
public final class ProductTypeReferenceResolutionUtils 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.product_type.ProductTypeDraft>
mapToProductTypeDrafts(java.util.List<com.commercetools.api.models.product_type.ProductType> productTypes, ReferenceIdToKeyCache referenceIdToKeyCache)
Returns anList
<ProductTypeDraft
> consisting of the results of applying the mapping fromProductType
toProductTypeDraft
with considering reference resolution.
-
-
-
Method Detail
-
mapToProductTypeDrafts
@Nonnull public static java.util.List<com.commercetools.api.models.product_type.ProductTypeDraft> mapToProductTypeDrafts(@Nonnull java.util.List<com.commercetools.api.models.product_type.ProductType> productTypes, @Nonnull ReferenceIdToKeyCache referenceIdToKeyCache)
Returns anList
<ProductTypeDraft
> consisting of the results of applying the mapping fromProductType
toProductTypeDraft
with 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
<ProductTypeReference
>Set
<ProductTypeReference
> (with key replaced with id field)Note:If some references are not expanded for an attributeDefinition of a productType, the method will throw a
ReferenceReplacementException
containing 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
List
ofProductTypeDraft
built from the suppliedList
ofProductType
.
-
-