2023-01-27 15:14:36 +01:00
|
|
|
package com.bib.essensbestellungsverwaltung;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
2023-02-01 22:52:04 +01:00
|
|
|
/**
|
|
|
|
* Food, used by FoodPlan
|
|
|
|
* one constructor is used to create new foods the other is used to create existing foods from database
|
|
|
|
* @author Malte Schulze Hobeling
|
|
|
|
*/
|
2023-01-27 15:14:36 +01:00
|
|
|
public class Food {
|
|
|
|
private long id;
|
|
|
|
private String name;
|
|
|
|
private String description;
|
|
|
|
private boolean isDessert;
|
|
|
|
private FoodType foodType;
|
|
|
|
private List<Allergy> allergies;
|
|
|
|
|
|
|
|
public Food(long id, String name, String description, boolean isDessert, FoodType foodType, List<Allergy> allergies) {
|
|
|
|
this.id = id;
|
|
|
|
this.name = name;
|
|
|
|
this.description = description;
|
|
|
|
this.isDessert = isDessert;
|
|
|
|
this.foodType = foodType;
|
|
|
|
this.allergies = allergies;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Food(String name, String description, boolean isDessert, FoodType foodType, List<Allergy> allergies) {
|
|
|
|
this.id = -1;
|
|
|
|
this.name = name;
|
|
|
|
this.description = description;
|
|
|
|
this.isDessert = isDessert;
|
|
|
|
this.foodType = foodType;
|
|
|
|
this.allergies = allergies;
|
|
|
|
}
|
|
|
|
|
|
|
|
public long getId() {
|
|
|
|
return id;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getName() {
|
|
|
|
return name;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getDescription() {
|
|
|
|
return description;
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isDessert() {
|
|
|
|
return isDessert;
|
|
|
|
}
|
|
|
|
|
|
|
|
public FoodType getFoodType() {
|
|
|
|
return foodType;
|
|
|
|
}
|
|
|
|
|
|
|
|
public List<Allergy> getAllergies() {
|
|
|
|
return allergies;
|
|
|
|
}
|
2023-01-30 04:26:30 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return getName();
|
|
|
|
}
|
2023-01-27 15:14:36 +01:00
|
|
|
}
|