Class CartDiscountReferenceResolutionUtils
- java.lang.Object
-
- com.commercetools.sync.cartdiscounts.utils.CartDiscountReferenceResolutionUtils
-
public final class CartDiscountReferenceResolutionUtils 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.cart_discount.CartDiscountDraft>
mapToCartDiscountDrafts(java.util.List<com.commercetools.api.models.cart_discount.CartDiscount> cartDiscounts, ReferenceIdToKeyCache referenceIdToKeyCache)
Returns anList
<CartDiscountDraft
> consisting of the results of applying the mapping fromCartDiscount
toCartDiscountDraft
with considering reference resolution.
-
-
-
Method Detail
-
mapToCartDiscountDrafts
@Nonnull public static java.util.List<com.commercetools.api.models.cart_discount.CartDiscountDraft> mapToCartDiscountDrafts(@Nonnull java.util.List<com.commercetools.api.models.cart_discount.CartDiscount> cartDiscounts, @Nonnull ReferenceIdToKeyCache referenceIdToKeyCache)
Returns anList
<CartDiscountDraft
> consisting of the results of applying the mapping fromCartDiscount
toCartDiscountDraft
with considering reference resolution.Mapping of Reference fields for the reference resolution Reference field from to custom.type TypeReference
TypeResourceIdentifier
Note: The
Type
reference should contain Id in the map(cache) with a key value. Any reference, which have its id in place and not replaced by the key, it would not be found in the map. In this case, this reference will be considered as existing resources on the target commercetools project and the library will issue an update/create API request without reference resolution.- Parameters:
cartDiscounts
- the cart discounts without expansion of references.referenceIdToKeyCache
- the instance that manages cache.- Returns:
- a
List
ofCartDiscountDraft
built from the suppliedList
ofCartDiscount
.
-
-