Compare commits
2 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
64333b037e | 4 months ago |
|
|
3fbbf30279 | 4 months ago |
@ -1,6 +0,0 @@
|
||||
public class ConcreteProductA implements Product {
|
||||
@Override
|
||||
public void operation() {
|
||||
System.out.println("ConcreteProductA operation");
|
||||
}
|
||||
}
|
||||
@ -1,13 +0,0 @@
|
||||
public class Factory {
|
||||
public static Product createProduct(String type) {
|
||||
if (type == null) {
|
||||
return null;
|
||||
}
|
||||
if (type.equalsIgnoreCase("A")) {
|
||||
return new ConcreteProductA();
|
||||
} else if (type.equalsIgnoreCase("B")) {
|
||||
return new ConcreteProductB();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue