001package headfirst.factory.pizzas; 002 003public class SimplePizzaFactory { 004 005 public Pizza createPizza(String type) { 006 Pizza pizza = null; 007 008 if (type.equals("cheese")) { 009 pizza = new CheesePizza(); 010 } else if (type.equals("pepperoni")) { 011 pizza = new PepperoniPizza(); 012 } else if (type.equals("clam")) { 013 pizza = new ClamPizza(); 014 } else if (type.equals("veggie")) { 015 pizza = new VeggiePizza(); 016 } 017 return pizza; 018 } 019}