Interface ProductAvailabilityStrategy
-
- All Known Implementing Classes:
DefaultProductAvailabilityStrategy
public interface ProductAvailabilityStrategyThis strategy will be used for calculating the availability of the specified product.- Spring Bean ID:
- productAvailabilityStrategy
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Map<WarehouseModel,java.util.Date>getAvailability(java.lang.String productCode, java.util.List<WarehouseModel> warehouses, int quantity)Gets availability date by invoking strategy for calculating product availability, passing product, quantity and warehouses as parameters.java.util.Map<WarehouseModel,java.lang.Integer>getAvailability(java.lang.String productCode, java.util.List<WarehouseModel> warehouses, java.util.Date date)Calculates product availability, passing the product, quantity and the warehouses for which the availability should be returned.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.
-
-
-
Method Detail
-
getAvailability
java.util.Map<WarehouseModel,java.lang.Integer> getAvailability(java.lang.String productCode, java.util.List<WarehouseModel> warehouses, java.util.Date date)
Calculates product availability, passing the product, quantity and the warehouses for which the availability should be returned.- Parameters:
productCode- code of the productwarehouses- the warehousesdate- the date the specified quantity has to be available at least.- Returns:
- the mapped quantities
-
getAvailability
java.util.Map<WarehouseModel,java.util.Date> getAvailability(java.lang.String productCode, java.util.List<WarehouseModel> warehouses, int quantity)
Gets availability date by invoking strategy for calculating product availability, passing product, quantity and warehouses as parameters.- Parameters:
productCode- code of the productwarehouses- the warehousesquantity- the asked quantity- Returns:
- Returns mapped availability dates
-
parse
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.- Parameters:
quantities- the mapped quantities
-
parse
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.- Parameters:
quantities- the mapped availability dates
-
getBestMatchOfQuantity
WarehouseModel getBestMatchOfQuantity(java.util.Map<WarehouseModel,java.lang.Integer> map)
-
getBestMatchOfAvailability
WarehouseModel getBestMatchOfAvailability(java.util.Map<WarehouseModel,java.util.Date> map)
-
-