public class DefaultCartService extends DefaultCartCheckoutBaseService implements CartService
| Constructor and Description |
|---|
DefaultCartService() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
addConfigurationToCart(ConfigModel configModel)
Adds a new configuration to the cart.
|
void |
addItemsToCart(java.util.List<Item> items) |
CartModificationData |
addToCart(java.lang.String code,
long quantity)
Adds an entry to the cart.
|
protected void |
checkForDeletion(java.math.BigDecimal quantity,
Item itemToUpdate)
Checks if cart item is meant to be deleted, which is indicated by a quantity zero.
|
protected java.math.BigDecimal |
convertQuantity(long quantity)
Converts a quantity into a BigDecimal so that BOL can consume it.
|
protected int |
convertToPositiveInt(long entryNumber) |
Converter<Item,OrderEntryData> |
getCartItemConverter() |
Converter<Message,CartModificationData> |
getMessageConverter() |
SalesAreaService |
getSalesAreaService() |
boolean |
isItemAvailable(java.lang.String itemKey)
Does an item exist with a given key?
|
void |
setCartItemConverter(Converter<Item,OrderEntryData> cartItemConverter) |
void |
setMessageConverter(Converter<Message,CartModificationData> messageConverter) |
void |
setSalesAreaService(SalesAreaService salesAreaService) |
CartModificationData |
updateCartEntry(long entryNumber,
long quantityAsLong)
Updates a cart entry
|
void |
updateConfigurationInCart(java.lang.String key,
ConfigModel configModel)
Updates the configuration attached to an item
|
java.util.List<CartModificationData> |
validateCartData()
Validates cart
|
compileSessionCart, createEmptyCart, getBolCartFacade, getCartConverter, getI18nService, getMessageSource, getSessionCart, getSessionCart, hasSessionCart, removeSessionCart, reverseCartSorting, reverseCartSorting, setBolCartFacade, setCartConverter, setI18nService, setMessageSourceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetSessionCart, getSessionCart, hasSessionCart, removeSessionCartpublic CartModificationData addToCart(java.lang.String code, long quantity)
CartServiceaddToCart in interface CartServicecode - Product IDquantity - Quantity to be addedpublic CartModificationData updateCartEntry(long entryNumber, long quantityAsLong)
CartServiceupdateCartEntry in interface CartServiceentryNumber - Item numberquantityAsLong - New quantity of itemprotected int convertToPositiveInt(long entryNumber)
entryNumber - protected void checkForDeletion(java.math.BigDecimal quantity,
Item itemToUpdate)
quantity - New item quantity, if zero: Item will be deleteditemToUpdate - BOL item to be updatedprotected java.math.BigDecimal convertQuantity(long quantity)
quantity - public java.util.List<CartModificationData> validateCartData()
CartServicevalidateCartData in interface CartServicepublic Converter<Item,OrderEntryData> getCartItemConverter()
public void setCartItemConverter(Converter<Item,OrderEntryData> cartItemConverter)
cartItemConverter - the cartItemConverter to setpublic Converter<Message,CartModificationData> getMessageConverter()
public void setMessageConverter(Converter<Message,CartModificationData> messageConverter)
messageConverter - the messageConverter to setpublic SalesAreaService getSalesAreaService()
public void setSalesAreaService(SalesAreaService salesAreaService)
salesAreaService - the salesAreaService to setpublic java.lang.String addConfigurationToCart(ConfigModel configModel)
CartServiceaddConfigurationToCart in interface CartServicepublic void updateConfigurationInCart(java.lang.String key,
ConfigModel configModel)
CartServiceupdateConfigurationInCart in interface CartServicekey - Key of existing itemconfigModel - Configurationpublic boolean isItemAvailable(java.lang.String itemKey)
CartServiceisItemAvailable in interface CartServicepublic void addItemsToCart(java.util.List<Item> items)
addItemsToCart in interface CartServiceCopyright © 2017 SAP SE. All Rights Reserved.