Class MensaMeal
java.lang.Object
edu.kit.aifb.atks.mensascraper.lib.MensaMeal
- All Implemented Interfaces:
Serializable
,Cloneable
Data class to capture all available information about a meal. Use getter methods (e.g.
getName()
) to access properties.
Prices are in Euro, nutrition facts are in grams.- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionMensaMeal
(String name, MensaLine line, float price, MensaMealType type) MensaMeal
(String name, MensaLine line, float price, MensaMealType type, float kcal, float proteins, float carbs, float sugar, float fat, float saturated, float salt, short scoreCo2, short scoreWater, short scoreAnimals, short scoreRainforest, float co2Emissions, float waterConsumption, List<String> additives) Creates a newMensaMeal
instance.MensaMeal
(String name, MensaLine line, float price, MensaMealType type, float kcal, float proteins, float carbs, float sugar, float fat, float saturated, float salt, List<String> additives) -
Method Summary
Modifier and TypeMethodDescriptionstatic MensaMeal.MensaMealBuilder
builder()
protected boolean
protected Object
clone()
copy()
Create a deep-copy of this object.boolean
List of additives / ingredients / allergens.float
getCarbs()
Amount of carbohydrates contained in the meal in grams (g).float
CO2 emissions of this meal in grams.float
getFat()
Amount of fat contained in the meal in grams (g).float
getKcal()
Amount of energy of the meal in kcal.getLine()
Counter inside the canteen offering this meal.getName()
Name of the meal.float
getPrice()
Price of the meal in Euros (€).float
Amount of proteins contained in the meal in grams (g).float
getSalt()
Amount of salt contained in the meal in grams (g).float
Amount of contained saturated fats in grams (g).short
Animal welfare rating of this meal (1-3 stars).short
Rating of emitted CO2 emissions of this meal (1-3 stars).short
Rainforest friendliness score of this meal (1-3 stars).short
Rating of water consumption of this meal (1-3 stars).float
getSugar()
Amount of sugar contained in the meal in grams (g).getType()
Type of the meal.float
Water consumption of this meal in liters.int
hashCode()
void
setAdditives
(List<String> additives) List of additives / ingredients / allergens.void
setCarbs
(float carbs) Amount of carbohydrates contained in the meal in grams (g).void
setCo2Emissions
(float co2Emissions) CO2 emissions of this meal in grams.void
setFat
(float fat) Amount of fat contained in the meal in grams (g).void
setKcal
(float kcal) Amount of energy of the meal in kcal.void
Counter inside the canteen offering this meal.void
Name of the meal.void
setPrice
(float price) Price of the meal in Euros (€).void
setProteins
(float proteins) Amount of proteins contained in the meal in grams (g).void
setSalt
(float salt) Amount of salt contained in the meal in grams (g).void
setSaturated
(float saturated) Amount of contained saturated fats in grams (g).void
setScoreAnimals
(short scoreAnimals) Animal welfare rating of this meal (1-3 stars).void
setScoreCo2
(short scoreCo2) Rating of emitted CO2 emissions of this meal (1-3 stars).void
setScoreRainforest
(short scoreRainforest) Rainforest friendliness score of this meal (1-3 stars).void
setScoreWater
(short scoreWater) Rating of water consumption of this meal (1-3 stars).void
setSugar
(float sugar) Amount of sugar contained in the meal in grams (g).void
setType
(MensaMealType type) Type of the meal.void
setWaterConsumption
(float waterConsumption) Water consumption of this meal in liters.toString()
withAdditives
(List<String> additives) List of additives / ingredients / allergens.withCarbs
(float carbs) Amount of carbohydrates contained in the meal in grams (g).withCo2Emissions
(float co2Emissions) CO2 emissions of this meal in grams.withFat
(float fat) Amount of fat contained in the meal in grams (g).withKcal
(float kcal) Amount of energy of the meal in kcal.Counter inside the canteen offering this meal.Name of the meal.withPrice
(float price) Price of the meal in Euros (€).withProteins
(float proteins) Amount of proteins contained in the meal in grams (g).withSalt
(float salt) Amount of salt contained in the meal in grams (g).withSaturated
(float saturated) Amount of contained saturated fats in grams (g).withScoreAnimals
(short scoreAnimals) Animal welfare rating of this meal (1-3 stars).withScoreCo2
(short scoreCo2) Rating of emitted CO2 emissions of this meal (1-3 stars).withScoreRainforest
(short scoreRainforest) Rainforest friendliness score of this meal (1-3 stars).withScoreWater
(short scoreWater) Rating of water consumption of this meal (1-3 stars).withSugar
(float sugar) Amount of sugar contained in the meal in grams (g).withType
(MensaMealType type) Type of the meal.withWaterConsumption
(float waterConsumption) Water consumption of this meal in liters.
-
Constructor Details
-
MensaMeal
-
MensaMeal
public MensaMeal(String name, MensaLine line, float price, MensaMealType type, float kcal, float proteins, float carbs, float sugar, float fat, float saturated, float salt, List<String> additives) -
MensaMeal
public MensaMeal(String name, MensaLine line, float price, MensaMealType type, float kcal, float proteins, float carbs, float sugar, float fat, float saturated, float salt, short scoreCo2, short scoreWater, short scoreAnimals, short scoreRainforest, float co2Emissions, float waterConsumption, List<String> additives) Creates a newMensaMeal
instance.- Parameters:
name
- Name of the meal.line
- Counter inside the canteen offering this meal.price
- Price of the meal in Euros (€).type
- Type of the meal.kcal
- Amount of energy of the meal in kcal.proteins
- Amount of proteins contained in the meal in grams (g).carbs
- Amount of carbohydrates contained in the meal in grams (g).sugar
- Amount of sugar contained in the meal in grams (g).fat
- Amount of fat contained in the meal in grams (g).saturated
- Amount of contained saturated fats in grams (g).salt
- Amount of salt contained in the meal in grams (g).scoreCo2
- Rating of emitted CO2 emissions of this meal (1-3 stars).scoreWater
- Rating of water consumption of this meal (1-3 stars).scoreAnimals
- Animal welfare rating of this meal (1-3 stars).scoreRainforest
- Rainforest friendliness score of this meal (1-3 stars).co2Emissions
- CO2 emissions of this meal in grams.waterConsumption
- Water consumption of this meal in liters.additives
- List of additives / ingredients / allergens. See List of allergens.
-
MensaMeal
public MensaMeal()
-
-
Method Details
-
copy
Create a deep-copy of this object.- Returns:
- Deep-copy of this object.
-
clone
-
builder
-
getName
Name of the meal. -
getLine
Counter inside the canteen offering this meal. -
getPrice
public float getPrice()Price of the meal in Euros (€). -
getType
Type of the meal. -
getKcal
public float getKcal()Amount of energy of the meal in kcal. -
getProteins
public float getProteins()Amount of proteins contained in the meal in grams (g). -
getCarbs
public float getCarbs()Amount of carbohydrates contained in the meal in grams (g). -
getSugar
public float getSugar()Amount of sugar contained in the meal in grams (g). -
getFat
public float getFat()Amount of fat contained in the meal in grams (g). -
getSaturated
public float getSaturated()Amount of contained saturated fats in grams (g). -
getSalt
public float getSalt()Amount of salt contained in the meal in grams (g). -
getScoreCo2
public short getScoreCo2()Rating of emitted CO2 emissions of this meal (1-3 stars). -
getScoreWater
public short getScoreWater()Rating of water consumption of this meal (1-3 stars). -
getScoreAnimals
public short getScoreAnimals()Animal welfare rating of this meal (1-3 stars). -
getScoreRainforest
public short getScoreRainforest()Rainforest friendliness score of this meal (1-3 stars). -
getCo2Emissions
public float getCo2Emissions()CO2 emissions of this meal in grams. -
getWaterConsumption
public float getWaterConsumption()Water consumption of this meal in liters. -
getAdditives
List of additives / ingredients / allergens. See List of allergens. -
setName
Name of the meal. -
setLine
Counter inside the canteen offering this meal. -
setPrice
public void setPrice(float price) Price of the meal in Euros (€). -
setType
Type of the meal. -
setKcal
public void setKcal(float kcal) Amount of energy of the meal in kcal. -
setProteins
public void setProteins(float proteins) Amount of proteins contained in the meal in grams (g). -
setCarbs
public void setCarbs(float carbs) Amount of carbohydrates contained in the meal in grams (g). -
setSugar
public void setSugar(float sugar) Amount of sugar contained in the meal in grams (g). -
setFat
public void setFat(float fat) Amount of fat contained in the meal in grams (g). -
setSaturated
public void setSaturated(float saturated) Amount of contained saturated fats in grams (g). -
setSalt
public void setSalt(float salt) Amount of salt contained in the meal in grams (g). -
setScoreCo2
public void setScoreCo2(short scoreCo2) Rating of emitted CO2 emissions of this meal (1-3 stars). -
setScoreWater
public void setScoreWater(short scoreWater) Rating of water consumption of this meal (1-3 stars). -
setScoreAnimals
public void setScoreAnimals(short scoreAnimals) Animal welfare rating of this meal (1-3 stars). -
setScoreRainforest
public void setScoreRainforest(short scoreRainforest) Rainforest friendliness score of this meal (1-3 stars). -
setCo2Emissions
public void setCo2Emissions(float co2Emissions) CO2 emissions of this meal in grams. -
setWaterConsumption
public void setWaterConsumption(float waterConsumption) Water consumption of this meal in liters. -
setAdditives
List of additives / ingredients / allergens. See List of allergens. -
toString
-
equals
-
canEqual
-
hashCode
public int hashCode() -
withName
Name of the meal.- Returns:
- a clone of this object, except with this updated property (returns
this
if an identical value is passed).
-
withLine
Counter inside the canteen offering this meal.- Returns:
- a clone of this object, except with this updated property (returns
this
if an identical value is passed).
-
withPrice
Price of the meal in Euros (€).- Returns:
- a clone of this object, except with this updated property (returns
this
if an identical value is passed).
-
withType
Type of the meal.- Returns:
- a clone of this object, except with this updated property (returns
this
if an identical value is passed).
-
withKcal
Amount of energy of the meal in kcal.- Returns:
- a clone of this object, except with this updated property (returns
this
if an identical value is passed).
-
withProteins
Amount of proteins contained in the meal in grams (g).- Returns:
- a clone of this object, except with this updated property (returns
this
if an identical value is passed).
-
withCarbs
Amount of carbohydrates contained in the meal in grams (g).- Returns:
- a clone of this object, except with this updated property (returns
this
if an identical value is passed).
-
withSugar
Amount of sugar contained in the meal in grams (g).- Returns:
- a clone of this object, except with this updated property (returns
this
if an identical value is passed).
-
withFat
Amount of fat contained in the meal in grams (g).- Returns:
- a clone of this object, except with this updated property (returns
this
if an identical value is passed).
-
withSaturated
Amount of contained saturated fats in grams (g).- Returns:
- a clone of this object, except with this updated property (returns
this
if an identical value is passed).
-
withSalt
Amount of salt contained in the meal in grams (g).- Returns:
- a clone of this object, except with this updated property (returns
this
if an identical value is passed).
-
withScoreCo2
Rating of emitted CO2 emissions of this meal (1-3 stars).- Returns:
- a clone of this object, except with this updated property (returns
this
if an identical value is passed).
-
withScoreWater
Rating of water consumption of this meal (1-3 stars).- Returns:
- a clone of this object, except with this updated property (returns
this
if an identical value is passed).
-
withScoreAnimals
Animal welfare rating of this meal (1-3 stars).- Returns:
- a clone of this object, except with this updated property (returns
this
if an identical value is passed).
-
withScoreRainforest
Rainforest friendliness score of this meal (1-3 stars).- Returns:
- a clone of this object, except with this updated property (returns
this
if an identical value is passed).
-
withCo2Emissions
CO2 emissions of this meal in grams.- Returns:
- a clone of this object, except with this updated property (returns
this
if an identical value is passed).
-
withWaterConsumption
Water consumption of this meal in liters.- Returns:
- a clone of this object, except with this updated property (returns
this
if an identical value is passed).
-
withAdditives
List of additives / ingredients / allergens. See List of allergens.- Returns:
- a clone of this object, except with this updated property (returns
this
if an identical value is passed).
-