2024-05-03 05:30:29 +02:00
|
|
|
package krusty;
|
|
|
|
|
|
|
|
public class Recipe {
|
|
|
|
public String name;
|
|
|
|
public Ingredient ingredients[];
|
|
|
|
|
|
|
|
public Recipe(String name, Ingredient[] ingredients) {
|
|
|
|
this.name = name;
|
|
|
|
this.ingredients = ingredients;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String toString() {
|
2024-05-05 10:44:07 +02:00
|
|
|
StringBuilder sb = new StringBuilder(name + ": ");
|
|
|
|
|
|
|
|
for (Ingredient i : ingredients) {
|
|
|
|
sb.append(i.toString());
|
|
|
|
sb.append(" ");
|
|
|
|
}
|
|
|
|
return sb.toString();
|
2024-05-03 05:30:29 +02:00
|
|
|
}
|
|
|
|
}
|