Ejemplo n.º 1
0
  @Override
  public void update(Cotisation obj) {

    if (!cotisations.contains(obj)) {
      throw new IndexOutOfBoundsException("L'objet a mettre a jour n'est pas dans la liste");
    }

    Cotisation cot = cotisations.get(cotisations.indexOf(obj));

    cot.setLibelle(obj.getLibelle());
    cot.setTaux(obj.getTaux());
  }
Ejemplo n.º 2
0
 @Override
 public int create(Cotisation obj) {
   int id = 1;
   if (obj.getId() == -1) {
     if (!cotisations.isEmpty()) {
       id = cotisations.get(cotisations.size() - 1).getId() + 1;
     }
   } else {
     id = obj.getId();
   }
   obj.setId(id);
   this.cotisations.add(obj);
   return id;
 }