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) {
9595 this .army = army ;
9696 }
9797
98- /**
99- * The factory of kingdom factories.
100- */
10198 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+ }
121120 }
122-
121+
123122 /**
124- * Program entry point
123+ * Program entry point.
125124 *
126125 * @param args
127126 * command line args
Original file line number Diff line number Diff line change 2525import static org .junit .Assert .assertEquals ;
2626import static org .junit .Assert .assertTrue ;
2727
28- import org .junit .Before ;
29- import org .junit .Test ;
30-
3128import com .iluwatar .abstractfactory .App .FactoryMaker ;
3229import com .iluwatar .abstractfactory .App .FactoryMaker .KingdomType ;
3330
31+ import org .junit .Before ;
32+ import org .junit .Test ;
33+
3434/**
3535 * Test for abstract factory
3636 */
You can’t perform that action at this time.
0 commit comments