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;
|
||||
}
|
||||
|
||||
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) {
|
||||
super(ingredient);
|
||||
this.amount = amount;
|
||||
|
|
|
|||
|
|
@ -54,9 +54,14 @@ public abstract class RecipeIngredient {
|
|||
// for ORM
|
||||
}
|
||||
|
||||
public RecipeIngredient(
|
||||
Ingredient ingredient) {
|
||||
//store it in the field
|
||||
public RecipeIngredient(Ingredient ingredient) {
|
||||
// Store it in the field
|
||||
this.ingredient = ingredient;
|
||||
}
|
||||
|
||||
public RecipeIngredient(Long id, Ingredient ingredient) {
|
||||
// For testing
|
||||
this.id = id;
|
||||
this.ingredient = ingredient;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,11 @@ public class VagueIngredient extends RecipeIngredient {
|
|||
this.description = description;
|
||||
}
|
||||
|
||||
public VagueIngredient(Long id, Ingredient ingredient, String description) {
|
||||
super(id, ingredient);
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public VagueIngredient(Ingredient ingredient, String description) {
|
||||
super(ingredient);
|
||||
this.description = description;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue