Class MensaMeal

java.lang.Object
edu.kit.aifb.atks.mensascraper.lib.MensaMeal
All Implemented Interfaces:
Serializable, Cloneable

public class MensaMeal extends Object implements 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:
  • Constructor Details

    • MensaMeal

      public MensaMeal(String name, MensaLine line, float price, MensaMealType type)
    • 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 new MensaMeal 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

      public MensaMeal copy()
      Create a deep-copy of this object.
      Returns:
      Deep-copy of this object.
    • clone

      protected Object clone()
      Overrides:
      clone in class Object
    • builder

      public static MensaMeal.MensaMealBuilder builder()
    • getName

      public String getName()
      Name of the meal.
    • getLine

      public MensaLine getLine()
      Counter inside the canteen offering this meal.
    • getPrice

      public float getPrice()
      Price of the meal in Euros (€).
    • getType

      public MensaMealType 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

      public List<String> getAdditives()
      List of additives / ingredients / allergens. See List of allergens.
    • setName

      public void setName(String name)
      Name of the meal.
    • setLine

      public void setLine(MensaLine line)
      Counter inside the canteen offering this meal.
    • setPrice

      public void setPrice(float price)
      Price of the meal in Euros (€).
    • setType

      public void setType(MensaMealType type)
      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

      public void setAdditives(List<String> additives)
      List of additives / ingredients / allergens. See List of allergens.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • withName

      public MensaMeal withName(String name)
      Name of the meal.
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withLine

      public MensaMeal withLine(MensaLine line)
      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

      public MensaMeal withPrice(float price)
      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

      public MensaMeal withType(MensaMealType type)
      Type of the meal.
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withKcal

      public MensaMeal withKcal(float kcal)
      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

      public MensaMeal withProteins(float proteins)
      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

      public MensaMeal withCarbs(float carbs)
      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

      public MensaMeal withSugar(float sugar)
      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

      public MensaMeal withFat(float fat)
      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

      public MensaMeal withSaturated(float saturated)
      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

      public MensaMeal withSalt(float salt)
      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

      public MensaMeal withScoreCo2(short scoreCo2)
      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

      public MensaMeal withScoreWater(short scoreWater)
      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

      public MensaMeal withScoreAnimals(short scoreAnimals)
      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

      public MensaMeal withScoreRainforest(short scoreRainforest)
      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

      public MensaMeal withCo2Emissions(float co2Emissions)
      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

      public MensaMeal withWaterConsumption(float waterConsumption)
      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

      public MensaMeal withAdditives(List<String> additives)
      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).