public final class SyncUtils
extends java.lang.Object
| Constructor and Description |
|---|
SyncUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <T extends io.sphere.sdk.types.CustomDraft> |
batchDrafts(java.util.List<T> drafts,
int batchSize)
Given a list of resource (e.g.
|
static java.util.List<io.sphere.sdk.categories.CategoryDraft> |
replaceCategoriesReferenceIdsWithKeys(java.util.List<io.sphere.sdk.categories.Category> categories)
Takes a list of Categories that are supposed to have their custom type and parent category reference expanded
in order to be able to fetch the keys and replace the reference ids with the corresponding keys and then return
a new list of category drafts with their references containing keys instead of the ids.
|
static java.util.List<io.sphere.sdk.inventory.InventoryEntryDraft> |
replaceInventoriesReferenceIdsWithKeys(java.util.List<io.sphere.sdk.inventory.InventoryEntry> inventoryEntries)
Takes a list of inventoryEntries that are supposed to have their custom type reference expanded
in order to be able to fetch the keys and replace the reference ids with the corresponding keys and then return
a new list of inventory entry drafts with their references containing keys instead of the ids.
|
public static <T extends io.sphere.sdk.types.CustomDraft> java.util.List<java.util.List<T>> batchDrafts(@Nonnull
java.util.List<T> drafts,
int batchSize)
batchSize, this method separates
the drafts into batches with the batchSize. Each batch is represented by a
List of resources and all the batches are grouped and represented by an
List<List> of resources, which is returned by the method.T - the type of the draft resources.drafts - the list of drafts to split into batches.batchSize - the size of each batch.@Nonnull
public static java.util.List<io.sphere.sdk.categories.CategoryDraft> replaceCategoriesReferenceIdsWithKeys(@Nonnull
java.util.List<io.sphere.sdk.categories.Category> categories)
categories - the categories to replace their reference ids with keys@Nonnull
public static java.util.List<io.sphere.sdk.inventory.InventoryEntryDraft> replaceInventoriesReferenceIdsWithKeys(@Nonnull
java.util.List<io.sphere.sdk.inventory.InventoryEntry> inventoryEntries)
inventoryEntries - the inventory entries to replace their reference ids with keys