chore(commons/logging): descriptive toString for models
This commit is contained in:
parent
e91d6355f0
commit
841fe75fad
2 changed files with 12 additions and 6 deletions
|
|
@ -103,6 +103,14 @@ public class Ingredient {
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(id, name, proteinPer100g, fatPer100g, carbsPer100g);
|
return Objects.hash(id, name, proteinPer100g, fatPer100g, carbsPer100g);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Ingredient " + id + " - " + name +
|
||||||
|
"= P:" + proteinPer100g +
|
||||||
|
"/F:" + fatPer100g +
|
||||||
|
"/C:" + carbsPer100g + " per 100g";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -157,12 +157,10 @@ public class Recipe {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "Recipe{" +
|
return "Recipe " + id +
|
||||||
"id=" + id +
|
" - " + name +
|
||||||
", name='" + name + '\'' +
|
": " + ingredients.size() + " ingredients / " +
|
||||||
", ingredientsCount=" + ingredients.size() +
|
preparationSteps.size() + " steps";
|
||||||
", preparationStepsCount=" + preparationSteps.size() +
|
|
||||||
"}";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue