コード例 #1
0
 public Client findById(long id) {
   for (Client client : clients) {
     if (client.getId_client() == id) {
       return client;
     }
   }
   return null;
 }
コード例 #2
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();
      }
    }
  }