Package de.hybris.platform.order.impl
Class DefaultDiscountService
java.lang.Object
de.hybris.platform.servicelayer.internal.service.AbstractService
de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
de.hybris.platform.order.impl.DefaultDiscountService
- All Implemented Interfaces:
DiscountService,Serializable,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationContextAware
public class DefaultDiscountService
extends AbstractBusinessService
implements DiscountService, org.springframework.context.ApplicationContextAware
Default implementation of the
DiscountService.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
AbstractService.SerializableDTO -
Field Summary
Fields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
modelService, sessionService, txManagerFields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
tenant -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidInvoked by a BeanFactory after it has set all bean properties supplied.getDiscountForCode(String code) Gets theDiscountModelwith the specified code.getDiscountInformation(BaseCriteria baseCriteria) Get discountsDiscountInformations for given criteria.getDiscountsForCode(String matchedCode) Gets allDiscountModels which match the specified code.getDiscountsForCurrency(CurrencyModel currency) Gets allDiscountModels which match the specified currency.voidsetApplicationContext(org.springframework.context.ApplicationContext ctx) voidsetDiscountDao(DiscountDao discountDao) voidsetFindDiscountValuesStrategy(FindDiscountValuesStrategy findDiscountValuesStrategy) Methods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
getModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManagerMethods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
getCurrentTenant, setBeanName, setCurrentTenant, writeReplace
-
Constructor Details
-
DefaultDiscountService
public DefaultDiscountService()
-
-
Method Details
-
getDiscountForCode
Description copied from interface:DiscountServiceGets theDiscountModelwith the specified code.- Specified by:
getDiscountForCodein interfaceDiscountService- Parameters:
code- the discount code- Returns:
- the found
DiscountModelwith the specified code
-
getDiscountsForCode
Description copied from interface:DiscountServiceGets allDiscountModels which match the specified code.- Specified by:
getDiscountsForCodein interfaceDiscountService- Parameters:
matchedCode- an SQL-Like statement as String, such as %discountCode%- Returns:
- the
Collectionof allDiscountModels which match the specified code
-
getDiscountsForCurrency
Description copied from interface:DiscountServiceGets allDiscountModels which match the specified currency.- Specified by:
getDiscountsForCurrencyin interfaceDiscountService- Parameters:
currency- targetCurrencyModel- Returns:
- the
Collectionof allDiscountModels which matching currency. If no matching discounts were found, an empty collection is returned.
-
getDiscountInformation
public List<DiscountInformation> getDiscountInformation(BaseCriteria baseCriteria) throws CalculationException Description copied from interface:DiscountServiceGet discountsDiscountInformations for given criteria.- Specified by:
getDiscountInformationin interfaceDiscountService- Parameters:
baseCriteria-BaseCriteria- Returns:
- the
Listof allDiscountInformations which matching baseCriteria. If no matching discounts were found, an empty collection is returned. - Throws:
CalculationException- if error occurred
-
setDiscountDao
-
setFindDiscountValuesStrategy
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext ctx) - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware
-
afterPropertiesSet
Description copied from class:AbstractServiceInvoked by a BeanFactory after it has set all bean properties supplied. Overwrite this method for adding/implementing additional code into the service. Important note: Please call alwayssuper.afterPropertiesSet()before or the java serialization won't work.- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Overrides:
afterPropertiesSetin classAbstractService- Throws:
Exception- See Also:
-
InitializingBean.afterPropertiesSet()
-