public final class VariantReferenceResolutionUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.util.List<io.sphere.sdk.products.ProductVariantDraft> |
mapToProductVariantDrafts(java.util.List<io.sphere.sdk.products.ProductVariant> productVariants)
Returns an
List<ProductVariantDraft> consisting of the results of applying the
mapping from ProductVariant to ProductVariantDraft with considering reference resolution. |
@Nonnull
public static java.util.List<io.sphere.sdk.products.ProductVariantDraft> mapToProductVariantDrafts(@Nonnull
java.util.List<io.sphere.sdk.products.ProductVariant> productVariants)
List<ProductVariantDraft> consisting of the results of applying the
mapping from ProductVariant to ProductVariantDraft with considering reference resolution.
| Reference field | from | to |
|---|---|---|
| variants.prices.channel | Reference<Channel> |
ResourceIdentifier<Channel> |
| variants.prices.customerGroup * | Reference<CustomerGroup> |
Reference<CustomerGroup> (with key replaced with id field) |
| variants.prices.custom.type | Reference<Type> |
ResourceIdentifier<Type> |
| variants.assets.custom.type | Reference<Type> |
ResourceIdentifier<Type> |
variants.attributes on List<Attribute * |
Reference<ProductType> (example for ProductType) |
Reference<ProductType> (with key replaced with id field) |
Note: The aforementioned references should be expanded with a key. Any reference that is not expanded will have its id in place and not replaced by the key will be considered as existing resources on the target commercetools project and the library will issues an update/create API request without reference resolution.
productVariants - the product variants with expanded references.List of ProductVariantDraft built from the
supplied List of ProductVariant.