Class DummyPriceFactoryImpl
- java.lang.Object
-
- de.hybris.platform.jalo.order.price.DummyPriceFactoryImpl
-
- All Implemented Interfaces:
PriceFactory
- Direct Known Subclasses:
CustomPriceFactoryTest.TinyPriceFactory
public class DummyPriceFactoryImpl extends java.lang.Object implements PriceFactory
will be renamed to 'DefaultPriceFactory' asap!
-
-
Constructor Summary
Constructors Constructor Description DummyPriceFactoryImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProductPriceInformationsgetAllPriceInformations(SessionContext ctx, Product product, java.util.Date date, boolean net)Implement this to calculates a product price quote containing all applicable prices, discounts and taxes for the given product and net/gross state.PriceValuegetBasePrice(AbstractOrderEntry entry)Implement this to define thebase priceof an order entryjava.util.ListgetDiscountValues(AbstractOrder order)Implement this to define(global) discount valuesfor an order.java.util.ListgetDiscountValues(AbstractOrderEntry entry)Implement this to definediscount valuesfor an order entry.java.util.ListgetProductDiscountInformations(SessionContext ctx, Product product, java.util.Date date, boolean net)Implement this to show all discounts which may apply to the given productjava.util.ListgetProductPriceInformations(SessionContext ctx, Product product, java.util.Date date, boolean net)Implement this to show all prices available for the given productjava.util.ListgetProductTaxInformations(SessionContext ctx, Product product, java.util.Date date)Implement this to show all taxes which apply to the given productjava.util.CollectiongetTaxValues(AbstractOrderEntry entry)Implement this to definetax valuesfor an order entry.booleanisNetUser(User user)Implement this to define whether a user should be treated as net or gross customer.
-
-
-
Method Detail
-
getAllPriceInformations
public ProductPriceInformations getAllPriceInformations(SessionContext ctx, Product product, java.util.Date date, boolean net) throws JaloPriceFactoryException
Description copied from interface:PriceFactoryImplement this to calculates a product price quote containing all applicable prices, discounts and taxes for the given product and net/gross state.This default implementation just calls
PriceFactory.getProductPriceInformations(SessionContext, Product, Date, boolean),PriceFactory.getProductTaxInformations(SessionContext, Product, Date)andPriceFactory.getProductDiscountInformations(SessionContext, Product, Date, boolean)and wraps the results inside aProductPriceInformationsobject.Override to define the prices, taxes and discounts for all occasions when no order or order entry is available, e.g. for product lists. Please take care also to override
PriceFactory.getProductPriceInformations(SessionContext, Product, Date, boolean),PriceFactory.getProductTaxInformations(SessionContext, Product, Date)andPriceFactory.getProductDiscountInformations(SessionContext, Product, Date, boolean)since these methods are called byProductdirectly.- Specified by:
getAllPriceInformationsin interfacePriceFactory- Throws:
JaloPriceFactoryException- if a calculation error occured
-
getBasePrice
public PriceValue getBasePrice(AbstractOrderEntry entry) throws JaloPriceFactoryException
Description copied from interface:PriceFactoryImplement this to define thebase priceof an order entry- Specified by:
getBasePricein interfacePriceFactory- Returns:
- a price with the order's currency iso code, 0.0 as value and the order's net status
- Throws:
JaloPriceFactoryException
-
getDiscountValues
public java.util.List getDiscountValues(AbstractOrder order) throws JaloPriceFactoryException
Description copied from interface:PriceFactoryImplement this to define(global) discount valuesfor an order.These discount values are applied to the whole order, not just to one entry like
PriceFactory.getDiscountValues(AbstractOrderEntry)- Specified by:
getDiscountValuesin interfacePriceFactory- Returns:
- the Collection of DiscountValues applicable to the given AbstractOrder
- Throws:
JaloPriceFactoryException
-
getDiscountValues
public java.util.List getDiscountValues(AbstractOrderEntry entry) throws JaloPriceFactoryException
Description copied from interface:PriceFactoryImplement this to definediscount valuesfor an order entry.- Specified by:
getDiscountValuesin interfacePriceFactory- Returns:
- the Collection of DiscountValues assigned to the given AbstractOrderEntry
- Throws:
JaloPriceFactoryException
-
getProductDiscountInformations
public java.util.List getProductDiscountInformations(SessionContext ctx, Product product, java.util.Date date, boolean net) throws JaloPriceFactoryException
Description copied from interface:PriceFactoryImplement this to show all discounts which may apply to the given product- Specified by:
getProductDiscountInformationsin interfacePriceFactoryproduct- the product- Returns:
- a list of
DiscountInformationobjects - Throws:
JaloPriceFactoryException- if price calculation error occured
-
getProductPriceInformations
public java.util.List getProductPriceInformations(SessionContext ctx, Product product, java.util.Date date, boolean net) throws JaloPriceFactoryException
Description copied from interface:PriceFactoryImplement this to show all prices available for the given product- Specified by:
getProductPriceInformationsin interfacePriceFactoryproduct- the productnet- the net/gross state of the requested prices- Returns:
- a list of
PriceInformationobjects - Throws:
JaloPriceFactoryException- if price calculation error occured
-
getProductTaxInformations
public java.util.List getProductTaxInformations(SessionContext ctx, Product product, java.util.Date date) throws JaloPriceFactoryException
Description copied from interface:PriceFactoryImplement this to show all taxes which apply to the given product- Specified by:
getProductTaxInformationsin interfacePriceFactoryproduct- the product- Returns:
- a list of
TaxInformationobjects - Throws:
JaloPriceFactoryException- if price calculation error occured
-
getTaxValues
public java.util.Collection getTaxValues(AbstractOrderEntry entry) throws JaloPriceFactoryException
Description copied from interface:PriceFactoryImplement this to definetax valuesfor an order entry.- Specified by:
getTaxValuesin interfacePriceFactory- Returns:
- the Collection of TaxValues assigned to the given AbstractOrderEntry
- Throws:
JaloPriceFactoryException
-
isNetUser
public boolean isNetUser(User user)
Description copied from interface:PriceFactoryImplement this to define whether a user should be treated as net or gross customer.- Specified by:
isNetUserin interfacePriceFactory- Returns:
- true, if the given user is treated as a net customer
-
-