Esempio n. 1
0
 private void setPrice(double price) {
   if (Validations.isValidDouble(price)) {
     this.price = price;
     return;
   }
   System.out.println(this.name + ": Invalid price!");
 }
Esempio n. 2
0
 private void setName(String name) {
   if (Validations.isValidString(name)) {
     this.name = name;
     return;
   }
   System.out.println("Incorrect name!");
 }