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
only the Variants expanded for the sync:
Variants of the LineItems
|
static io.sphere.sdk.shoppinglists.ShoppingListDraft |
mapToShoppingListDraft(io.sphere.sdk.shoppinglists.ShoppingList shoppingList,
ReferenceIdToKeyCache referenceIdToKeyCache)
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,
ReferenceIdToKeyCache referenceIdToKeyCache)
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, @Nonnull ReferenceIdToKeyCache referenceIdToKeyCache)
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 contain Id in the map(cache) with a key value. Any reference, which have its id in place and not replaced by the key, it would not be found in the map. In this case, 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.
shoppingLists
- the shopping lists without expansion of references.referenceIdToKeyCache
- the instance that manages cache.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, @Nonnull ReferenceIdToKeyCache referenceIdToKeyCache)
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 contain Id in the map(cache) with a key value. Any reference, which have its id in place and not replaced by the key, it would not be found in the map. In this case, 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.
shoppingList
- the shopping list without expansion of references.referenceIdToKeyCache
- the instance that manages cache.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
only the Variants expanded for the sync:
Note: Please only use this util if you desire to sync the aforementioned reference from a source commercetools project. Otherwise, it is more efficient to build the query without expansion, if it is not needed, to avoid unnecessarily bigger payloads fetched from the source project.