コード例 #1
0
 public Client findByName(String name) {
   for (Client client : clients) {
     if (client.getNom().equalsIgnoreCase(name)) {
       return client;
     }
   }
   return null;
 }
コード例 #2
0
 public Client findById(long id) {
   for (Client client : clients) {
     if (client.getId_client() == id) {
       return client;
     }
   }
   return null;
 }
コード例 #3
0
  public void deleteClientById(long id) {

    for (Iterator<Client> iterator = clients.iterator(); iterator.hasNext(); ) {
      Client client = iterator.next();
      if (client.getId_client() == id) {
        iterator.remove();
      }
    }
  }
コード例 #4
0
 public boolean isClientExist(Client client) {
   return findByName(client.getNom()) != null;
 }
コード例 #5
0
 public void saveClient(Client client) {
   client.setId_client(counter.incrementAndGet());
   clients.add(client);
 }