public void modifierPrix(Montant nouveauPrix) throws PrixNegatifException, PrixNulException { if (nouveauPrix.estNegatif()) { throw new PrixNegatifException(); } else if (nouveauPrix.estNul()) { throw new PrixNulException(); } this.prix = nouveauPrix; }
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; }