예제 #1
0
  public void modifierPrix(Montant nouveauPrix) throws PrixNegatifException, PrixNulException {
    if (nouveauPrix.estNegatif()) {
      throw new PrixNegatifException();
    } else if (nouveauPrix.estNul()) {
      throw new PrixNulException();
    }

    this.prix = nouveauPrix;
  }
예제 #2
0
  public Article(String nom, String description, Montant prix)
      throws PrixNegatifException, PrixNulException {
    if (prix.estNegatif()) {
      throw new PrixNegatifException();
    } else if (prix.estNul()) {
      throw new PrixNulException();
    }

    this.nom = nom;
    this.description = description;
    this.prix = prix;
  }