Ejemplo n.º 1
0
 public Collection<Owner> findOwners(String lastName) throws ServiceException {
   ArrayList<Owner> found = new ArrayList<Owner>();
   for (Owner owner : OWNERS.values()) {
     if ((owner.getLastName() != null) && (owner.getLastName().equals(lastName))) {
       found.add(owner);
     }
   }
   return found;
 }
Ejemplo n.º 2
0
 static {
   for (int i = 1; i <= 9; i++) {
     Owner owner = new Owner();
     owner.setId(i);
     owner.setAddress(String.format("address %s", i));
     owner.setCity(String.format("city %s", i));
     owner.setFirstName("Owner");
     owner.setLastName(String.format("%tA", new GregorianCalendar(2000, 1, i)));
     owner.setTelephone(String.format("%1$s%1$s%1$s-%1$s%1$s%1$s-%1$s%1$s%1$s%1$s", i));
     OWNERS.put(i, owner);
   }
 }
Ejemplo n.º 3
0
 public void storeOwner(Owner owner) throws ServiceException {
   OWNERS.put(owner.getId(), owner);
 }