public class DefaultItemListItemMergingService<I extends com.broadleafcommerce.cart.client.domain.ItemListItem> extends AbstractItemMergingService<com.broadleafcommerce.cart.client.domain.ItemList,I> implements ItemListItemMergingService<I>
Constructor and Description |
---|
DefaultItemListItemMergingService(@NonNull CatalogProvider catalogProvider,
@NonNull CartOperationServiceProperties properties) |
Modifier and Type | Method and Description |
---|---|
protected void |
doMergeCombine(@NonNull MergeItemPair<I> itemPair)
Perform the actual combination of two items (quantity change) for the combination merge type.
|
protected CatalogProvider |
getCatalogProvider() |
protected Collection<I> |
getItemsFromContainer(@NonNull com.broadleafcommerce.cart.client.domain.ItemList container,
com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Gets the from the item container.
|
protected CartOperationServiceProperties |
getProperties() |
protected String |
hashMatchingCriteria(@NonNull com.broadleafcommerce.cart.client.domain.ItemListItem item)
Generates a hash for any information on the item that should be used to determine if they
represent the same item configuration.
|
protected boolean |
isSameItem(@NonNull com.broadleafcommerce.cart.client.domain.ItemListItem item1,
@NonNull com.broadleafcommerce.cart.client.domain.ItemListItem item2)
Tells if two item instances are actually the same instance.
|
protected void |
resolveMergeTypes(@NonNull List<MergeItemPair<I>> mergeItemPairs,
com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Determines what merge types should be used for the items and applies it to the merge item
pairs.
|
findMatchingItems, findMatchingItems, handleRejectedMerges, merge, mergeCombine, mergeIgnore, mergeItems, mergeSeparate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
mergeItems
public DefaultItemListItemMergingService(@NonNull @NonNull CatalogProvider catalogProvider, @NonNull @NonNull CartOperationServiceProperties properties)
protected Collection<I> getItemsFromContainer(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.ItemList container, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
AbstractItemMergingService
getItemsFromContainer
in class AbstractItemMergingService<com.broadleafcommerce.cart.client.domain.ItemList,I extends com.broadleafcommerce.cart.client.domain.ItemListItem>
container
- the container to fetch the items fromcontext
- the context of the requestprotected boolean isSameItem(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.ItemListItem item1, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.ItemListItem item2)
AbstractItemMergingService
isSameItem
in class AbstractItemMergingService<com.broadleafcommerce.cart.client.domain.ItemList,I extends com.broadleafcommerce.cart.client.domain.ItemListItem>
item1
- an item to compareitem2
- another item to compareprotected String hashMatchingCriteria(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.ItemListItem item)
AbstractItemMergingService
hashMatchingCriteria
in class AbstractItemMergingService<com.broadleafcommerce.cart.client.domain.ItemList,I extends com.broadleafcommerce.cart.client.domain.ItemListItem>
item
- the item to generate a hash forprotected void resolveMergeTypes(@NonNull @NonNull List<MergeItemPair<I>> mergeItemPairs, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
AbstractItemMergingService
resolveMergeTypes
in class AbstractItemMergingService<com.broadleafcommerce.cart.client.domain.ItemList,I extends com.broadleafcommerce.cart.client.domain.ItemListItem>
mergeItemPairs
- the item pairs to resolve the merge types forprotected void doMergeCombine(@NonNull @NonNull MergeItemPair<I> itemPair)
AbstractItemMergingService
doMergeCombine
in class AbstractItemMergingService<com.broadleafcommerce.cart.client.domain.ItemList,I extends com.broadleafcommerce.cart.client.domain.ItemListItem>
itemPair
- the item pair to combineprotected CatalogProvider getCatalogProvider()
protected CartOperationServiceProperties getProperties()
Copyright © 2021. All rights reserved.