public class DefaultCartItemMergingService<I extends com.broadleafcommerce.cart.client.domain.CartItem> extends AbstractItemMergingService<com.broadleafcommerce.cart.client.domain.Cart,I> implements CartItemMergingService<I>
Constructor and Description |
---|
DefaultCartItemMergingService(CartOperationServiceProviders providers,
CartOperationServiceProperties properties,
com.fasterxml.jackson.databind.ObjectMapper objectMapper) |
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 Collection<I> |
getItemsFromContainer(@NonNull com.broadleafcommerce.cart.client.domain.Cart container,
com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Gets the from the item container.
|
protected com.fasterxml.jackson.databind.ObjectMapper |
getObjectMapper() |
protected CartOperationServiceProperties |
getProperties() |
protected CartOperationServiceProviders |
getProviders() |
protected String |
hashMatchingCriteria(I 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.CartItem item1,
@NonNull com.broadleafcommerce.cart.client.domain.CartItem 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 DefaultCartItemMergingService(CartOperationServiceProviders providers, CartOperationServiceProperties properties, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
protected Collection<I> getItemsFromContainer(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart container, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
AbstractItemMergingService
getItemsFromContainer
in class AbstractItemMergingService<com.broadleafcommerce.cart.client.domain.Cart,I extends com.broadleafcommerce.cart.client.domain.CartItem>
container
- the container to fetch the items fromcontext
- the context of the requestprotected boolean isSameItem(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem item1, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem item2)
AbstractItemMergingService
isSameItem
in class AbstractItemMergingService<com.broadleafcommerce.cart.client.domain.Cart,I extends com.broadleafcommerce.cart.client.domain.CartItem>
item1
- an item to compareitem2
- another item to compareprotected String hashMatchingCriteria(@NonNull I item)
hashMatchingCriteria
in class AbstractItemMergingService<com.broadleafcommerce.cart.client.domain.Cart,I extends com.broadleafcommerce.cart.client.domain.CartItem>
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.Cart,I extends com.broadleafcommerce.cart.client.domain.CartItem>
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.Cart,I extends com.broadleafcommerce.cart.client.domain.CartItem>
itemPair
- the item pair to combineprotected CartOperationServiceProviders getProviders()
protected CartOperationServiceProperties getProperties()
protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
Copyright © 2021. All rights reserved.