Compare commits
No commits in common. 'master' and 'main' have entirely different histories.
@ -1 +0,0 @@
|
||||
Subproject commit 43e557cf39f84ccbf9ca62957def1729424b6502
|
||||
@ -1 +0,0 @@
|
||||
Subproject commit f5f32aff1bd200132cf6f9ca8e55f34bf564f923
|
||||
@ -1,6 +0,0 @@
|
||||
public class ConcreteProductA implements Product {
|
||||
@Override
|
||||
public void operation() {
|
||||
System.out.println("ConcreteProductA operation");
|
||||
}
|
||||
}
|
||||
@ -1,6 +0,0 @@
|
||||
public class ConcreteProductB implements Product {
|
||||
@Override
|
||||
public void operation() {
|
||||
System.out.println("ConcreteProductB 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;
|
||||
}
|
||||
}
|
||||
@ -1,3 +0,0 @@
|
||||
public interface Product {
|
||||
void operation();
|
||||
}
|
||||
Loading…
Reference in new issue