Exemplo n.º 1
0
 /**
  * @param customerName
  * @return Customer associated by the given name, or null if the customer cannot be found.
  */
 public Customer findCustomerByNameAndType(String customerName, PowerType type) {
   for (Entry<CustomerInfo, Customer> entry : customerMap.entrySet()) {
     CustomerInfo key = entry.getKey();
     Customer value = entry.getValue();
     if (key.getName().equals(customerName) && (key.getPowerType() == type)) {
       return value;
     }
   }
   return null;
 }