Example #1
0
 Pizza(PizzaBuilder pizzaBuilder) {
   this.base = pizzaBuilder.getBase();
   this.type = pizzaBuilder.getType();
   this.cheese = pizzaBuilder.isCheese();
   this.garlic = pizzaBuilder.isGarlic();
   this.nuts = pizzaBuilder.isNuts();
 }
Example #2
0
  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);
  }
Example #3
0
 public Pizza getPizza() {
   return pizzaBuilder.getPizza();
 }
Example #4
0
 public void constructPizza() {
   pizzaBuilder.createNewPizzaProduct();
   pizzaBuilder.buildDough();
   pizzaBuilder.buildSauce();
   pizzaBuilder.buildTopping();
 }