mirror of
https://github.com/jlengrand/baker-recipe-tuto.git
synced 2026-03-10 08:01:22 +00:00
Starts translating to English
This commit is contained in:
@@ -4,8 +4,7 @@ import com.google.common.collect.ImmutableList;
|
||||
import com.ing.baker.core.Interaction;
|
||||
import com.ing.baker.java_api.JInteractionDescriptor;
|
||||
import com.ing.baker.java_api.JRecipe;
|
||||
import erwtensoep.events.BoodschappenGedaan;
|
||||
import erwtensoep.events.Cooked5MinutesEvent;
|
||||
import erwtensoep.events.GroceriesDone;
|
||||
import erwtensoep.events.KitchenToolsReady;
|
||||
import erwtensoep.interactions.*;
|
||||
|
||||
@@ -16,7 +15,7 @@ import java.util.List;
|
||||
* The class should be removed and replaced by scala implementations instead
|
||||
* Created by jll on 5/4/2017.
|
||||
*/
|
||||
public final class ErwtenSoepRecipeUtils {
|
||||
public final class PeaSoupRecipeUtils {
|
||||
|
||||
public JRecipe createRecipe(){
|
||||
return new JRecipe("ErwtenSoepRecipe")
|
||||
@@ -24,11 +23,11 @@ public final class ErwtenSoepRecipeUtils {
|
||||
JInteractionDescriptor.of(PreheatSoup.class),
|
||||
JInteractionDescriptor.of(ChopVegetables.class),
|
||||
JInteractionDescriptor.of(CutBoiledMeat.class),
|
||||
JInteractionDescriptor.of(CombineErwtenSoep.class),
|
||||
JInteractionDescriptor.of(AddRookWorst.class))
|
||||
JInteractionDescriptor.of(CombineDutchPeaSoup.class),
|
||||
JInteractionDescriptor.of(AddSmokedSausage.class))
|
||||
.withSensoryEvents(
|
||||
KitchenToolsReady.class,
|
||||
BoodschappenGedaan.class);
|
||||
GroceriesDone.class);
|
||||
}
|
||||
|
||||
public List<Interaction> getInteractions(){
|
||||
@@ -36,8 +35,8 @@ public final class ErwtenSoepRecipeUtils {
|
||||
new PreheatSoup(),
|
||||
new ChopVegetables(),
|
||||
new CutBoiledMeat(),
|
||||
new CombineErwtenSoep(),
|
||||
new AddRookWorst()
|
||||
new CombineDutchPeaSoup(),
|
||||
new AddSmokedSausage()
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -2,22 +2,20 @@ package erwtensoep.interactions;
|
||||
|
||||
import com.ing.baker.java_api.FiresEvent;
|
||||
import com.ing.baker.java_api.JInteraction;
|
||||
import com.ing.baker.java_api.ProvidesIngredient;
|
||||
import com.ing.baker.java_api.RequiresIngredient;
|
||||
import erwtensoep.events.Cooked5MinutesEvent;
|
||||
import erwtensoep.ingredients.ErwtenSoep;
|
||||
import erwtensoep.ingredients.ErwtenSoepMetRookWorst;
|
||||
import erwtensoep.ingredients.DutchPeaSoup;
|
||||
import erwtensoep.ingredients.RookWorst;
|
||||
|
||||
/**
|
||||
* Created by jll on 5/5/2017.
|
||||
*/
|
||||
public class AddRookWorst implements JInteraction{
|
||||
public class AddSmokedSausage implements JInteraction{
|
||||
|
||||
@FiresEvent(oneOf = Cooked5MinutesEvent.class)
|
||||
public Cooked5MinutesEvent apply(
|
||||
@RequiresIngredient("rookWorst")RookWorst rookWorst,
|
||||
@RequiresIngredient("ErwtenSoep")ErwtenSoep erwtenSoep
|
||||
@RequiresIngredient("ErwtenSoep") DutchPeaSoup erwtenSoep
|
||||
){
|
||||
System.out.println("Adding sausage");
|
||||
return new Cooked5MinutesEvent();
|
||||
@@ -12,8 +12,8 @@ public class ChopVegetables implements JInteraction{
|
||||
|
||||
@ProvidesIngredient("ChoppedVegetables")
|
||||
public ChoppedVegetables apply(
|
||||
@RequiresIngredient("snijPlank")SnijPlank snijPlank,
|
||||
@RequiresIngredient("mes")Mes mes,
|
||||
@RequiresIngredient("cuttingBoard") CuttingBoard cuttingBoard,
|
||||
@RequiresIngredient("knife") Knife knife,
|
||||
@RequiresIngredient("prei")Prei prei,
|
||||
@RequiresIngredient("aardappel")Aardappel aardappel,
|
||||
@RequiresIngredient("winterwortel")WinterWortel winterwortel,
|
||||
|
||||
@@ -8,17 +8,17 @@ import erwtensoep.ingredients.*;
|
||||
/**
|
||||
* Created by jll on 5/5/2017.
|
||||
*/
|
||||
public class CombineErwtenSoep implements JInteraction{
|
||||
public class CombineDutchPeaSoup implements JInteraction{
|
||||
|
||||
@ProvidesIngredient("ErwtenSoep")
|
||||
public ErwtenSoep apply(
|
||||
public DutchPeaSoup apply(
|
||||
@RequiresIngredient("ChoppedMeat")ChoppedMeat choppedMeat,
|
||||
@RequiresIngredient("ChoppedVegetables")ChoppedVegetables choppedVegetables,
|
||||
@RequiresIngredient("HeatedBasicSoup")HeatedBasicSoup heatedBasicSoup,
|
||||
@RequiresIngredient("lepel") Lepel lepel
|
||||
@RequiresIngredient("spoon") Spoon spoon
|
||||
){
|
||||
System.out.println("Mixing all ingredients together");
|
||||
return new ErwtenSoep();
|
||||
return new DutchPeaSoup();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,8 +5,8 @@ import com.ing.baker.java_api.ProvidesIngredient;
|
||||
import com.ing.baker.java_api.RequiresIngredient;
|
||||
import erwtensoep.ingredients.ChoppedMeat;
|
||||
import erwtensoep.ingredients.HeatedBasicSoup;
|
||||
import erwtensoep.ingredients.Mes;
|
||||
import erwtensoep.ingredients.SnijPlank;
|
||||
import erwtensoep.ingredients.Knife;
|
||||
import erwtensoep.ingredients.CuttingBoard;
|
||||
|
||||
/**
|
||||
* Created by jll on 5/5/2017.
|
||||
@@ -15,8 +15,8 @@ public class CutBoiledMeat implements JInteraction {
|
||||
|
||||
@ProvidesIngredient("ChoppedMeat")
|
||||
public ChoppedMeat apply(
|
||||
@RequiresIngredient("snijPlank")SnijPlank snijPlank,
|
||||
@RequiresIngredient("mes")Mes mes,
|
||||
@RequiresIngredient("cuttingBoard") CuttingBoard cuttingBoard,
|
||||
@RequiresIngredient("knife") Knife knife,
|
||||
@RequiresIngredient("HeatedBasicSoup")HeatedBasicSoup heatedBasicSoup
|
||||
){
|
||||
System.out.println("Chopping boiled meat");
|
||||
|
||||
@@ -18,8 +18,8 @@ public class PreheatSoup implements JInteraction{
|
||||
@RequiresIngredient("hamschrijf") Hamschijf hamschijf,
|
||||
@RequiresIngredient("zout") Zout zout,
|
||||
@RequiresIngredient("pan") Pan pan,
|
||||
@RequiresIngredient("lepel") Lepel lepel,
|
||||
@RequiresIngredient("gasFournuis") GasFournuis gasFournuis
|
||||
@RequiresIngredient("spoon") Spoon spoon,
|
||||
@RequiresIngredient("furnace") Furnace furnace
|
||||
){
|
||||
System.out.println("Heating Basic Soup ingredients");
|
||||
return new HeatedBasicSoup();
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
package erwtensoep.interactions;
|
||||
|
||||
import com.ing.baker.java_api.JInteraction;
|
||||
import com.ing.baker.java_api.ProvidesIngredient;
|
||||
import com.ing.baker.java_api.RequiresIngredient;
|
||||
import erwtensoep.ingredients.CookedErwtenSoepMetRookWorst;
|
||||
import erwtensoep.ingredients.ErwtenSoep;
|
||||
import erwtensoep.ingredients.ErwtenSoepMetRookWorst;
|
||||
import erwtensoep.ingredients.RookWorst;
|
||||
|
||||
/**
|
||||
* Created by jll on 5/8/2017.
|
||||
*/
|
||||
public class ServeErwtenSoepWithSmokedSausage implements JInteraction {
|
||||
|
||||
@ProvidesIngredient("cookedErwtenSoepMetRookWorst")
|
||||
public CookedErwtenSoepMetRookWorst apply(
|
||||
@RequiresIngredient("erwtenSoepMetRookWorst") ErwtenSoepMetRookWorst erwtenSoepMetRookWorst
|
||||
){
|
||||
System.out.println("Finished cooking 5 minutes. Ready to serve!");
|
||||
return new CookedErwtenSoepMetRookWorst();
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,8 @@ import java.util.UUID
|
||||
|
||||
import com.google.common.collect.ImmutableList
|
||||
import com.ing.baker.java_api.{JBaker, JCompiledRecipe}
|
||||
import erwtensoep.ErwtenSoepRecipeUtils
|
||||
import erwtensoep.events.{BoodschappenGedaan, KitchenToolsReady}
|
||||
import erwtensoep.PeaSoupRecipeUtils
|
||||
import erwtensoep.events.{GroceriesDone, KitchenToolsReady}
|
||||
import erwtensoep.ingredients.SplitErwten
|
||||
import erwtensoep.interactions.PreheatSoup
|
||||
|
||||
@@ -14,7 +14,7 @@ object ErwtenSoepCooker {
|
||||
def main(args: Array[String]): Unit = {
|
||||
|
||||
// Let's create a recipe and validate it
|
||||
val recipeCreator = new ErwtenSoepRecipeUtils
|
||||
val recipeCreator = new PeaSoupRecipeUtils
|
||||
val recipe = recipeCreator.createRecipe()
|
||||
val compiledRecipe = recipe.compileRecipe
|
||||
|
||||
@@ -32,7 +32,7 @@ object ErwtenSoepCooker {
|
||||
|
||||
//Firing events
|
||||
baker.processEvent(id, new KitchenToolsReady())
|
||||
baker.processEvent(id, new BoodschappenGedaan())
|
||||
baker.processEvent(id, new GroceriesDone())
|
||||
|
||||
// Recipe should be ran now
|
||||
val ingredients = baker.getIngredients(id);
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package erwtensoep.events
|
||||
|
||||
import com.ing.baker.api.Event
|
||||
import erwtensoep.ingredients.ErwtenSoepMetRookWorst
|
||||
import erwtensoep.ingredients.PeaSoupWithSmokedSausage
|
||||
|
||||
/**
|
||||
* Created by jll on 5/8/2017.
|
||||
*/
|
||||
class Cooked5MinutesEvent extends Event{
|
||||
|
||||
val erwtenSoepMetRookWorst = new ErwtenSoepMetRookWorst()
|
||||
val erwtenSoepMetRookWorst = new PeaSoupWithSmokedSausage()
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import erwtensoep.ingredients._
|
||||
/**
|
||||
* Created by jll on 5/4/2017.
|
||||
*/
|
||||
class BoodschappenGedaan extends Event {
|
||||
class GroceriesDone extends Event {
|
||||
val zout = new Zout
|
||||
val laurier = new Laurier
|
||||
val prei = new Prei
|
||||
@@ -8,8 +8,8 @@ import erwtensoep.ingredients._
|
||||
*/
|
||||
class KitchenToolsReady extends Event{
|
||||
val pan = new Pan
|
||||
val mes = new Mes
|
||||
val lepel = new Lepel
|
||||
val gasFournuis = new GasFournuis
|
||||
val snijPlank = new SnijPlank
|
||||
val knife = new Knife
|
||||
val spoon = new Spoon
|
||||
val furnace = new Furnace
|
||||
val cuttingBoard = new CuttingBoard
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import com.ing.baker.api.Ingredient
|
||||
class KitchenTools
|
||||
|
||||
class Pan extends Ingredient
|
||||
class Mes extends Ingredient
|
||||
class Lepel extends Ingredient
|
||||
class GasFournuis extends Ingredient
|
||||
class SnijPlank extends Ingredient
|
||||
class Knife extends Ingredient
|
||||
class Spoon extends Ingredient
|
||||
class Furnace extends Ingredient
|
||||
class CuttingBoard extends Ingredient
|
||||
@@ -9,16 +9,15 @@ class SoupElements
|
||||
|
||||
class ChoppedVegetables extends Ingredient
|
||||
class HeatedBasicSoup extends Ingredient{
|
||||
val boiledHamschrijf = new BoiledHamSchrijf();
|
||||
val boiledRookSpek = new BoiledRookSpek();
|
||||
val boiledHamschrijf = new BoiledHam();
|
||||
val boiledRookSpek = new BoiledBacon();
|
||||
val broth = new Broth();
|
||||
}
|
||||
|
||||
class BoiledHamSchrijf extends Ingredient
|
||||
class BoiledRookSpek extends Ingredient
|
||||
class BoiledHam extends Ingredient
|
||||
class BoiledBacon extends Ingredient
|
||||
class Broth extends Ingredient
|
||||
class ChoppedMeat extends Ingredient
|
||||
|
||||
class ErwtenSoep extends Ingredient
|
||||
class ErwtenSoepMetRookWorst extends Ingredient
|
||||
class CookedErwtenSoepMetRookWorst extends Ingredient
|
||||
class DutchPeaSoup extends Ingredient
|
||||
class PeaSoupWithSmokedSausage extends Ingredient
|
||||
Reference in New Issue
Block a user