Interface ProductAvailabilityStrategy
- All Known Implementing Classes:
DefaultProductAvailabilityStrategy
public interface ProductAvailabilityStrategy
This strategy will be used for calculating the availability of the specified product.
- Spring Bean ID:
- productAvailabilityStrategy
-
Method Summary
Modifier and TypeMethodDescriptiongetAvailability(String productCode, List<WarehouseModel> warehouses, int quantity) Gets availability date by invoking strategy for calculating product availability, passing product, quantity and warehouses as parameters.getAvailability(String productCode, List<WarehouseModel> warehouses, Date date) Calculates product availability, passing the product, quantity and the warehouses for which the availability should be returned.parse(Map<WarehouseModel, Integer> quantities, String productCode, Date date, LanguageModel language) Converted the mapped quantities in a textual representation.parse(Map<WarehouseModel, Date> quantities, String productCode, int quantity, LanguageModel language) Converted the mapped availability in a textual representation.
-
Method Details
-
getAvailability
Map<WarehouseModel,Integer> getAvailability(String productCode, List<WarehouseModel> warehouses, 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
Map<WarehouseModel,Date> getAvailability(String productCode, 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
String parse(Map<WarehouseModel, Integer> quantities, String productCode, Date date, LanguageModel language) Converted the mapped quantities in a textual representation.- Parameters:
quantities- the mapped quantities
-
parse
String parse(Map<WarehouseModel, Date> quantities, String productCode, int quantity, LanguageModel language) Converted the mapped availability in a textual representation.- Parameters:
quantities- the mapped availability dates
-
getBestMatchOfQuantity
-
getBestMatchOfAvailability
-