Class DefaultProductAvailabilityStrategy
- java.lang.Object
-
- de.hybris.platform.stock.strategy.impl.DefaultProductAvailabilityStrategy
-
- All Implemented Interfaces:
ProductAvailabilityStrategy
public class DefaultProductAvailabilityStrategy extends java.lang.Object implements ProductAvailabilityStrategy
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceDefaultProductAvailabilityStrategy.RESOURCEBUNDLE
-
Constructor Summary
Constructors Constructor Description DefaultProductAvailabilityStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<WarehouseModel,java.util.Date>getAvailability(java.lang.String productCode, java.util.List<WarehouseModel> warehouses, int preOrderQuantity)Returns product availability, passing product, and quantity as parameters.java.util.Map<WarehouseModel,java.lang.Integer>getAvailability(java.lang.String productCode, java.util.List<WarehouseModel> warehouses, java.util.Date date)Gets the product quantity for the specified product, warehouses and date.WarehouseModelgetBestMatchOfAvailability(java.util.Map<WarehouseModel,java.util.Date> map)WarehouseModelgetBestMatchOfQuantity(java.util.Map<WarehouseModel,java.lang.Integer> map)java.lang.Stringparse(java.util.Map<WarehouseModel,java.lang.Integer> quantities, java.lang.String productCode, java.util.Date date, LanguageModel language)Converted the mapped quantities in a textual representation.java.lang.Stringparse(java.util.Map<WarehouseModel,java.util.Date> quantities, java.lang.String productCode, int quantity, LanguageModel language)Converted the mapped availability in a textual representation.voidsetBestMatchStrategy(BestMatchStrategy bestMatchStrategy)voidsetBundleProvider(ResourceBundleProvider bundleProvider)voidsetI18nService(I18NService i18nService)voidsetStockLevelDao(StockLevelDao stockLevelDao)
-
-
-
Method Detail
-
parse
public java.lang.String parse(java.util.Map<WarehouseModel,java.lang.Integer> quantities, java.lang.String productCode, java.util.Date date, LanguageModel language)
Converted the mapped quantities in a textual representation. The default templates will generate output like ...Warehouse: {warehouse} Product: {product} Availability: {availability} Date: {date} ... Warehouse: {warehouse} Product: {product} Availability: {availability} Date: {date} Total: {total}- Specified by:
parsein interfaceProductAvailabilityStrategy- Parameters:
quantities- the mapped quantitiesproductCode- the product for which the quantities belongs todate- the date of the availability (unused yet)language- the language used for the localization process
-
parse
public java.lang.String parse(java.util.Map<WarehouseModel,java.util.Date> quantities, java.lang.String productCode, int quantity, LanguageModel language)
Converted the mapped availability in a textual representation. The default templates will generate output like ...Warehouse: {warehouse} Product: {product} Availability: {availability} Date: {date} ... Warehouse: {warehouse} Product: {product} Availability: {availability} Date: {date} Total: {total}- Specified by:
parsein interfaceProductAvailabilityStrategy- Parameters:
quantities- the mapped availability dates
-
getAvailability
public java.util.Map<WarehouseModel,java.lang.Integer> getAvailability(java.lang.String productCode, java.util.List<WarehouseModel> warehouses, java.util.Date date)
Gets the product quantity for the specified product, warehouses and date.- Specified by:
getAvailabilityin interfaceProductAvailabilityStrategy- Parameters:
warehouses- the warehousesproductCode- code of the productdate- the date the specified quantity has to be available at least. ... will NOT be evaluated by this implementation !!!- Returns:
- Returns mapped available quantity of product in all specified warehouses.
-
getAvailability
public java.util.Map<WarehouseModel,java.util.Date> getAvailability(java.lang.String productCode, java.util.List<WarehouseModel> warehouses, int preOrderQuantity)
Returns product availability, passing product, and quantity as parameters.- Specified by:
getAvailabilityin interfaceProductAvailabilityStrategy- Parameters:
productCode- code of the productwarehouses- the warehousespreOrderQuantity- the asked min. preOrderQuantity- Returns:
- Returns the date, when the questioned quantity will be available
-
getBestMatchOfQuantity
public WarehouseModel getBestMatchOfQuantity(java.util.Map<WarehouseModel,java.lang.Integer> map)
- Specified by:
getBestMatchOfQuantityin interfaceProductAvailabilityStrategy
-
getBestMatchOfAvailability
public WarehouseModel getBestMatchOfAvailability(java.util.Map<WarehouseModel,java.util.Date> map)
- Specified by:
getBestMatchOfAvailabilityin interfaceProductAvailabilityStrategy
-
setI18nService
public void setI18nService(I18NService i18nService)
-
setBundleProvider
public void setBundleProvider(ResourceBundleProvider bundleProvider)
-
setBestMatchStrategy
public void setBestMatchStrategy(BestMatchStrategy bestMatchStrategy)
- Parameters:
bestMatchStrategy- the bestMatchStrategy to set
-
setStockLevelDao
public void setStockLevelDao(StockLevelDao stockLevelDao)
-
-