public final class InventoryReferenceResolutionUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static io.sphere.sdk.inventory.queries.InventoryEntryQuery |
buildInventoryQuery()
Builds a
InventoryEntryQuery for fetching inventories from a source CTP project with all the
needed references expanded for the sync:
Custom Type
Supply Channel
|
static java.util.List<io.sphere.sdk.inventory.InventoryEntryDraft> |
mapToInventoryEntryDrafts(java.util.List<io.sphere.sdk.inventory.InventoryEntry> inventoryEntries)
Returns an
List<InventoryEntryDraft> consisting of the results of applying the
mapping from InventoryEntry to InventoryEntryDraft with considering reference resolution. |
@Nonnull
public static java.util.List<io.sphere.sdk.inventory.InventoryEntryDraft> mapToInventoryEntryDrafts(@Nonnull
java.util.List<io.sphere.sdk.inventory.InventoryEntry> inventoryEntries)
List<InventoryEntryDraft> consisting of the results of applying the
mapping from InventoryEntry to InventoryEntryDraft with considering reference resolution.
| Reference field | from | to |
|---|---|---|
| supplyChannel | Reference<Channel> |
ResourceIdentifier<Channel> |
| custom.type | Reference<Type> |
ResourceIdentifier<Type> |
Note: The Channel and Type 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.
inventoryEntries - the inventory entries with expanded references.List of InventoryEntryDraft built from the
supplied List of InventoryEntry.public static io.sphere.sdk.inventory.queries.InventoryEntryQuery buildInventoryQuery()
InventoryEntryQuery for fetching inventories from a source CTP project with all the
needed references expanded for the sync:
Note: Please only use this util if you desire to sync all the aforementioned references from a source commercetools project. Otherwise, it is more efficient to build the query without expansions, if they are not needed, to avoid unnecessarily bigger payloads fetched from the source project.