Pizza(PizzaBuilder pizzaBuilder) { this.base = pizzaBuilder.getBase(); this.type = pizzaBuilder.getType(); this.cheese = pizzaBuilder.isCheese(); this.garlic = pizzaBuilder.isGarlic(); this.nuts = pizzaBuilder.isNuts(); }
public static void main(String[] args) { PizzaBuilder pizzaBuilder = new PizzaBuilder() .adicionarMolho("vermelhor") .adicionarRecheio("Queijo") .escolherMassa("Integral"); Pizza pizza = pizzaBuilder.getPizza(); System.out.println(pizza); Pizza.Builder builder = new Builder("Integral", "Tomate", "Frango"); Pizza p = builder.build(); System.out.println(p); Pizza.Builder builder2 = new Builder("Integral", "Tomate", "Frango").adicionarBordaRecheada("Cheedar"); Pizza pizza2 = builder2.build(); System.out.println(pizza2); }
public Pizza getPizza() { return pizzaBuilder.getPizza(); }
public void constructPizza() { pizzaBuilder.createNewPizzaProduct(); pizzaBuilder.buildDough(); pizzaBuilder.buildSauce(); pizzaBuilder.buildTopping(); }