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,java.io.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 theDiscountService.- See Also:
- Serialized Form
-
-
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, txManager
-
Fields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
tenant
-
-
Constructor Summary
Constructors Constructor Description DefaultDiscountService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()Invoked by a BeanFactory after it has set all bean properties supplied.DiscountModelgetDiscountForCode(java.lang.String code)Gets theDiscountModelwith the specified code.java.util.List<DiscountInformation>getDiscountInformation(BaseCriteria baseCriteria)Get discountsDiscountInformations for given criteria.java.util.Collection<DiscountModel>getDiscountsForCode(java.lang.String matchedCode)Gets allDiscountModels which match the specified code.java.util.Collection<DiscountModel>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, setTxManager
-
Methods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
getCurrentTenant, setBeanName, setCurrentTenant, writeReplace
-
-
-
-
Method Detail
-
getDiscountForCode
public DiscountModel getDiscountForCode(java.lang.String code)
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
public java.util.Collection<DiscountModel> getDiscountsForCode(java.lang.String matchedCode)
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
public java.util.Collection<DiscountModel> getDiscountsForCurrency(CurrencyModel currency)
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 java.util.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
public void setDiscountDao(DiscountDao discountDao)
-
setFindDiscountValuesStrategy
public void setFindDiscountValuesStrategy(FindDiscountValuesStrategy findDiscountValuesStrategy)
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext ctx)
- Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.ExceptionDescription 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:
java.lang.Exception- See Also:
InitializingBean.afterPropertiesSet()
-
-