MCPcopy Create free account
hub / github.com/InterviewReady/Low-Level-Design / removeUnit

Method removeUnit

InventorySystem.java:30–39  ·  view source on GitHub ↗
(Product product)

Source from the content-addressed store, hash-verified

28 }
29
30 public static void removeUnit(Product product) {
31 for (Map.Entry<Location, Unit> entry: locationMap.entrySet()){
32 // if (SimpleStrategy.works())
33 //get lock on entry.getKey()
34 if(entry.getValue()!=null && product.id.equals(entry.getValue().productId)){
35 locationMap.remove(entry.getKey());
36 }
37 //release lock
38 }
39 }
40
41 public static Map<Location, Unit> getShelvesStatus(){
42 return locationMap;

Callers 1

executeOrderMethod · 0.95

Calls 3

getValueMethod · 0.80
getKeyMethod · 0.80
equalsMethod · 0.45

Tested by

no test coverage detected