public final class CategoryReferenceResolutionUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.util.List<io.sphere.sdk.categories.CategoryDraft> |
mapToCategoryDrafts(java.util.List<io.sphere.sdk.categories.Category> categories,
ReferenceIdToKeyCache referenceIdToKeyCache)
Returns an
List<CategoryDraft> consisting of the results of applying the
mapping from Category to CategoryDraft with considering reference resolution. |
@Nonnull
public static java.util.List<io.sphere.sdk.categories.CategoryDraft> mapToCategoryDrafts(@Nonnull
java.util.List<io.sphere.sdk.categories.Category> categories,
@Nonnull
ReferenceIdToKeyCache referenceIdToKeyCache)
List<CategoryDraft> consisting of the results of applying the
mapping from Category to CategoryDraft with considering reference resolution.
| Reference field | from | to |
|---|---|---|
| parent | Reference<Category> |
ResourceIdentifier<Category> |
| custom.type | Reference<Type> |
ResourceIdentifier<Type> |
| asset.custom.type | Reference<Type> |
ResourceIdentifier<Type> |
Note: The Category and Type references should contain Id in the
map(cache) with a key value. Any reference that is not available in the map will have its id in
place and not replaced by the key. This reference will be considered as existing resources on
the target commercetools project and the library will issues an update/create API request
without reference resolution.
categories - the categories without expansion of references.referenceIdToKeyCache - the instance that manages cache.List of CategoryDraft built from the supplied List of Category.