fix(commons/ingredient): add missing setters

This commit is contained in:
Zhongheng Liu 2026-01-15 17:10:01 +01:00
commit 9f7f32beff
Signed by: steven
GPG key ID: F69B980899C1C09D
4 changed files with 21 additions and 10 deletions

View file

@ -84,10 +84,21 @@ public class Ingredient {
public double getCarbsPer100g() {
return carbsPer100g;
}
public Long getId() {
return id;
}
public void setCarbsPer100g(double carbsPer100g) {
this.carbsPer100g = carbsPer100g;
}
public void setFatPer100g(double fatPer100g) {
this.fatPer100g = fatPer100g;
}
public void setProteinPer100g(double proteinPer100g) {
this.proteinPer100g = proteinPer100g;
}
public String getName() {
return name;
@ -101,7 +112,7 @@ public class Ingredient {
public boolean equals(Object o) {
if (o == null || getClass() != o.getClass()) return false;
Ingredient that = (Ingredient) o;
return id == that.id && Double.compare(proteinPer100g, that.proteinPer100g) == 0 && Double.compare(fatPer100g, that.fatPer100g) == 0 && Double.compare(carbsPer100g, that.carbsPer100g) == 0 && Objects.equals(name, that.name);
return Objects.equals(id, that.id) && Double.compare(proteinPer100g, that.proteinPer100g) == 0 && Double.compare(fatPer100g, that.fatPer100g) == 0 && Double.compare(carbsPer100g, that.carbsPer100g) == 0 && Objects.equals(name, that.name);
}
@Override