File tree Expand file tree Collapse file tree 2 files changed +26
-27
lines changed
main/java/com/iluwatar/abstractfactory
test/java/com/iluwatar/abstractfactory Expand file tree Collapse file tree 2 files changed +26
-27
lines changed Original file line number Diff line number Diff line change @@ -95,33 +95,32 @@ private void setArmy(final Army army) {
95
95
this .army = army ;
96
96
}
97
97
98
- /**
99
- * The factory of kingdom factories.
100
- */
101
98
public static class FactoryMaker {
102
-
103
- private FactoryMaker () {}
104
-
105
- public enum KingdomType {
106
- ELF ,
107
- ORC
108
- }
109
-
110
- public static KingdomFactory makeFactory (KingdomType type ) {
111
-
112
- switch (type ) {
113
- case ELF :
114
- return new ElfKingdomFactory ();
115
- case ORC :
116
- return new OrcKingdomFactory ();
117
- default :
118
- throw new IllegalArgumentException ("KingdomType not supported." );
119
- }
120
- }
99
+
100
+ private FactoryMaker () {
101
+ }
102
+
103
+ public enum KingdomType {
104
+ ELF , ORC
105
+ }
106
+
107
+ /**
108
+ * The factory of kingdom factories.
109
+ */
110
+ public static KingdomFactory makeFactory (KingdomType type ) {
111
+ switch (type ) {
112
+ case ELF :
113
+ return new ElfKingdomFactory ();
114
+ case ORC :
115
+ return new OrcKingdomFactory ();
116
+ default :
117
+ throw new IllegalArgumentException ("KingdomType not supported." );
118
+ }
119
+ }
121
120
}
122
-
121
+
123
122
/**
124
- * Program entry point
123
+ * Program entry point.
125
124
*
126
125
* @param args
127
126
* command line args
Original file line number Diff line number Diff line change 25
25
import static org .junit .Assert .assertEquals ;
26
26
import static org .junit .Assert .assertTrue ;
27
27
28
- import org .junit .Before ;
29
- import org .junit .Test ;
30
-
31
28
import com .iluwatar .abstractfactory .App .FactoryMaker ;
32
29
import com .iluwatar .abstractfactory .App .FactoryMaker .KingdomType ;
33
30
31
+ import org .junit .Before ;
32
+ import org .junit .Test ;
33
+
34
34
/**
35
35
* Test for abstract factory
36
36
*/
You can’t perform that action at this time.
0 commit comments