methoden angepasst

This commit is contained in:
Madeleine Vigier 2022-12-15 19:37:26 +01:00
parent 4a146547e7
commit ce62929779

View File

@ -1,10 +1,14 @@
/**
* Menue is a class to built a menue
*
* @author: Madeleine Vigier
* @version: 1.0
*/
public class Menue { public class Menue {
String date; String date;
String dish; String dish;
String sideDish; String sideDish;
String typ; String typ;
String desertV;
String desert;
boolean eggs; boolean eggs;
boolean peanuts; boolean peanuts;
boolean fish; boolean fish;
@ -28,13 +32,41 @@ public class Menue {
boolean phosphate; boolean phosphate;
boolean artificialSweetener; boolean artificialSweetener;
public Menue(String date, String dish, String sideDish, String typ, String desertV, String desert, boolean eggs, boolean peanuts, boolean fish, boolean grains, boolean crustaceans, boolean lupines, boolean milk, boolean nuts, boolean sulfurDioxideAndSulfite, boolean celeriac, boolean mustards, boolean sesame, boolean soy, boolean molluscs, boolean antioxidant, boolean artificialColours, boolean flavourEnhancer, boolean preservatives, boolean nitrate, boolean picklingSalt, boolean phosphate, boolean artificialSweetener) { /**
* constructor
*
* @param date date of meal
* @param dish meal
* @param sideDish side dish
* @param typ vegan, vegetarian or meat
* @param eggs allergens
* @param peanuts allergens
* @param fish allergens
* @param grains allergens
* @param crustaceans allergens
* @param lupines allergens
* @param milk allergens
* @param nuts allergens
* @param sulfurDioxideAndSulfite additives
* @param celeriac additives
* @param mustards additives
* @param sesame additives
* @param soy additives
* @param molluscs additives
* @param antioxidant additives
* @param artificialColours additives
* @param flavourEnhancer additives
* @param preservatives additives
* @param nitrate additives
* @param picklingSalt additives
* @param phosphate additives
* @param artificialSweetener additives
*/
public Menue(String date, String dish, String sideDish, String typ, boolean eggs, boolean peanuts, boolean fish, boolean grains, boolean crustaceans, boolean lupines, boolean milk, boolean nuts, boolean sulfurDioxideAndSulfite, boolean celeriac, boolean mustards, boolean sesame, boolean soy, boolean molluscs, boolean antioxidant, boolean artificialColours, boolean flavourEnhancer, boolean preservatives, boolean nitrate, boolean picklingSalt, boolean phosphate, boolean artificialSweetener) {
this.date = date; this.date = date;
this.dish = dish; this.dish = dish;
this.sideDish = sideDish; this.sideDish = sideDish;
this.typ = typ; this.typ = typ;
this.desertV = desertV;
this.desert = desert;
this.eggs = eggs; this.eggs = eggs;
this.peanuts = peanuts; this.peanuts = peanuts;
this.fish = fish; this.fish = fish;
@ -59,6 +91,7 @@ public class Menue {
this.artificialSweetener = artificialSweetener; this.artificialSweetener = artificialSweetener;
} }
public String getDate() { public String getDate() {
return date; return date;
} }
@ -72,31 +105,45 @@ public class Menue {
} }
public String getTyp() { public String getTyp() {
return typ; if (typ.equals("DessertV") || typ.equals("Dessert")) {
return "";
} else {
return typ;
}
} }
public String getDesertV() { public String getEggs() {
return desertV; if (eggs) {
return "a";
} else {
return "";
}
} }
public String getDesert() { public String getPeanuts() {
return desert; if (peanuts) {
return "d";
} else {
return "";
}
} }
public boolean isEggs() { public String getFish() {
return eggs; if (fish) {
return "m";
} else {
return "";
}
} }
public boolean isPeanuts() { public String getGrains() {
return peanuts; if (grains) {
} return "a";
} else {
public boolean isFish() { return "";
return fish; }
}
public boolean isGrains() {
return grains;
} }
public boolean isCrustaceans() { public boolean isCrustaceans() {
@ -173,36 +220,8 @@ public class Menue {
@Override @Override
public String toString() { public String toString() {
return "\t\t\t\tMENÜPLAN\n" + return "Montag\n" + "\t\t\t\t" + dish + "\n" + sideDish
"Montag\n" + date + "\t" + + "Allergene" + "\n" + getTyp();
", dish='" + dish + '\'' +
", sideDish='" + sideDish + '\'' +
", typ='" + typ + '\'' +
", desertV='" + desertV + '\'' +
", desert='" + desert + '\'' +
", eggs=" + eggs +
", peanuts=" + peanuts +
", fish=" + fish +
", grains=" + grains +
", crustaceans=" + crustaceans +
", lupines=" + lupines +
", milk=" + milk +
", nuts=" + nuts +
", sulfurDioxideAndSulfite=" + sulfurDioxideAndSulfite +
", celeriac=" + celeriac +
", mustards=" + mustards +
", sesame=" + sesame +
", soy=" + soy +
", molluscs=" + molluscs +
", antioxidant=" + antioxidant +
", artificialColours=" + artificialColours +
", flavourEnhancer=" + flavourEnhancer +
", preservatives=" + preservatives +
", nitrate=" + nitrate +
", picklingSalt=" + picklingSalt +
", phosphate=" + phosphate +
", artificialSweetener=" + artificialSweetener +
'}';
} }
} }