8000 Fix checkstyle validations · codeyu/java-design-patterns@3634b33 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 3634b33

Browse files
committed
Fix checkstyle validations
1 parent d37922b commit 3634b33

File tree

2 files changed

+26
-27
lines changed

2 files changed

+26
-27
lines changed

abstract-factory/src/main/java/com/iluwatar/abstractfactory/App.java

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff 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

abstract-factory/src/test/java/com/iluwatar/abstractfactory/AbstractFactoryTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@
2525
import static org.junit.Assert.assertEquals;
2626
import static org.junit.Assert.assertTrue;
2727

28-
import org.junit.Before;
29-
import org.junit.Test;
30-
3128
import com.iluwatar.abstractfactory.App.FactoryMaker;
3229
import 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
*/

0 commit comments

Comments
 (0)
0