Ingredient Constructors for testing
This commit is contained in:
parent
d37d95f1d4
commit
9008bdd026
3 changed files with 20 additions and 3 deletions
|
|
@ -31,6 +31,13 @@ public class FormalIngredient extends RecipeIngredient implements Scalable<Forma
|
||||||
this.unitSuffix = unitSuffix;
|
this.unitSuffix = unitSuffix;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public FormalIngredient(Long id, Ingredient ingredient, double amount, String unitSuffix) {
|
||||||
|
// For testing
|
||||||
|
super(id, ingredient);
|
||||||
|
this.amount = amount;
|
||||||
|
this.unitSuffix = unitSuffix;
|
||||||
|
}
|
||||||
|
|
||||||
public FormalIngredient(Ingredient ingredient, double amount, String unitSuffix) {
|
public FormalIngredient(Ingredient ingredient, double amount, String unitSuffix) {
|
||||||
super(ingredient);
|
super(ingredient);
|
||||||
this.amount = amount;
|
this.amount = amount;
|
||||||
|
|
|
||||||
|
|
@ -54,9 +54,14 @@ public abstract class RecipeIngredient {
|
||||||
// for ORM
|
// for ORM
|
||||||
}
|
}
|
||||||
|
|
||||||
public RecipeIngredient(
|
public RecipeIngredient(Ingredient ingredient) {
|
||||||
Ingredient ingredient) {
|
// Store it in the field
|
||||||
//store it in the field
|
this.ingredient = ingredient;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RecipeIngredient(Long id, Ingredient ingredient) {
|
||||||
|
// For testing
|
||||||
|
this.id = id;
|
||||||
this.ingredient = ingredient;
|
this.ingredient = ingredient;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,11 @@ public class VagueIngredient extends RecipeIngredient {
|
||||||
this.description = description;
|
this.description = description;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public VagueIngredient(Long id, Ingredient ingredient, String description) {
|
||||||
|
super(id, ingredient);
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
public VagueIngredient(Ingredient ingredient, String description) {
|
public VagueIngredient(Ingredient ingredient, String description) {
|
||||||
super(ingredient);
|
super(ingredient);
|
||||||
this.description = description;
|
this.description = description;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue