public final class ShoppingListReferenceResolutionUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static io.sphere.sdk.shoppinglists.queries.ShoppingListQuery |
buildShoppingListQuery()
Builds a
ShoppingListQuery for fetching shopping lists from a source CTP project with
all the needed references expanded for the sync:
Customer
Custom Type of the Shopping List
Variants of the LineItems
Custom Types of the LineItems
Custom Types of the TextLineItems
|
static io.sphere.sdk.shoppinglists.ShoppingListDraft |
mapToShoppingListDraft(io.sphere.sdk.shoppinglists.ShoppingList shoppingList)
Returns a @link ShoppingListDraft} consisting of the result of applying the mapping from
ShoppingList to ShoppingListDraft with considering reference resolution. |
static java.util.List<io.sphere.sdk.shoppinglists.ShoppingListDraft> |
mapToShoppingListDrafts(java.util.List<io.sphere.sdk.shoppinglists.ShoppingList> shoppingLists)
Returns a
List<ShoppingListDraft> consisting of the results of applying
the mapping from ShoppingList to ShoppingListDraft with considering reference
resolution. |
@Nonnull
public static java.util.List<io.sphere.sdk.shoppinglists.ShoppingListDraft> mapToShoppingListDrafts(@Nonnull
java.util.List<io.sphere.sdk.shoppinglists.ShoppingList> shoppingLists)
List<ShoppingListDraft> consisting of the results of applying
the mapping from ShoppingList to ShoppingListDraft with considering reference
resolution.
| Reference field | from | to |
|---|---|---|
| customer | Reference<Customer> |
ResourceIdentifier<Customer> |
| custom.type | Reference<Type> |
ResourceIdentifier<Type> |
| lineItems.custom.type | Set<Reference<Type>> |
Set<ResourceIdentifier<Type>> |
| textLineItems.custom.type | Set<Reference<Type>> |
Set<ResourceIdentifier<Type>> |
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.
shoppingLists - the shopping lists with expanded references.List of ShoppingListDraft built from the supplied List of
ShoppingList.@Nonnull
public static io.sphere.sdk.shoppinglists.ShoppingListDraft mapToShoppingListDraft(@Nonnull
io.sphere.sdk.shoppinglists.ShoppingList shoppingList)
ShoppingList to ShoppingListDraft with considering reference resolution.
| Reference field | from | to |
|---|---|---|
| customer | Reference<Customer> |
ResourceIdentifier<Customer> |
| custom.type | Reference<Type> |
ResourceIdentifier<Type> |
| lineItems.custom.type | Set<Reference<Type>> |
Set<ResourceIdentifier<Type>> |
| textLineItems.custom.type | Set<Reference<Type>> |
Set<ResourceIdentifier<Type>> |
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.
shoppingList - the shopping list with expanded references.ShoppingListDraft built from the supplied ShoppingList.public static io.sphere.sdk.shoppinglists.queries.ShoppingListQuery buildShoppingListQuery()
ShoppingListQuery for fetching shopping lists 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.