Skip to content

Commit 84efa30

Browse files
committed
Merge pull request iluwatar#7 from lordmat0/master
Formatted all files to the same standard
2 parents 3999854 + 3da9ad5 commit 84efa30

File tree

151 files changed

+952
-870
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+952
-870
lines changed
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
package com.iluwatar;
22

33
/**
4-
*
4+
*
55
* The essence of the Abstract Factory pattern is a factory interface
66
* (KingdomFactory) and its implementations (ElfKingdomFactory,
77
* OrcKingdomFactory).
8-
*
8+
*
99
* The example uses both concrete implementations to create a king, a castle and
1010
* an army.
11-
*
11+
*
1212
*/
1313
public class App {
1414

15-
public static void main(String[] args) {
16-
createKingdom(new ElfKingdomFactory());
17-
createKingdom(new OrcKingdomFactory());
18-
}
15+
public static void main(String[] args) {
16+
createKingdom(new ElfKingdomFactory());
17+
createKingdom(new OrcKingdomFactory());
18+
}
1919

20-
public static void createKingdom(KingdomFactory factory) {
21-
King king = factory.createKing();
22-
Castle castle = factory.createCastle();
23-
Army army = factory.createArmy();
24-
System.out.println("The kingdom was created.");
25-
System.out.println(king);
26-
System.out.println(castle);
27-
System.out.println(army);
28-
}
20+
public static void createKingdom(KingdomFactory factory) {
21+
King king = factory.createKing();
22+
Castle castle = factory.createCastle();
23+
Army army = factory.createArmy();
24+
System.out.println("The kingdom was created.");
25+
System.out.println(king);
26+
System.out.println(castle);
27+
System.out.println(army);
28+
}
2929
}

abstract-factory/src/main/java/com/iluwatar/ElfArmy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ public class ElfArmy implements Army {
66
public String toString() {
77
return "This is the Elven Army!";
88
}
9-
9+
1010
}

abstract-factory/src/main/java/com/iluwatar/ElfCastle.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ public class ElfCastle implements Castle {
66
public String toString() {
77
return "This is the Elven castle!";
88
}
9-
9+
1010
}

abstract-factory/src/main/java/com/iluwatar/ElfKing.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ public class ElfKing implements King {
66
public String toString() {
77
return "This is the Elven king!";
88
}
9-
9+
1010
}

abstract-factory/src/main/java/com/iluwatar/ElfKingdomFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
*
55
* Concrete factory.
6-
*
6+
*
77
*/
88
public class ElfKingdomFactory implements KingdomFactory {
99

abstract-factory/src/main/java/com/iluwatar/KingdomFactory.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
/**
44
*
55
* The factory interface.
6-
*
6+
*
77
*/
88
public interface KingdomFactory {
99

1010
Castle createCastle();
11+
1112
King createKing();
13+
1214
Army createArmy();
13-
15+
1416
}

abstract-factory/src/main/java/com/iluwatar/OrcArmy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ public class OrcArmy implements Army {
66
public String toString() {
77
return "This is the Orcish Army!";
88
}
9-
9+
1010
}

abstract-factory/src/main/java/com/iluwatar/OrcCastle.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ public class OrcCastle implements Castle {
66
public String toString() {
77
return "This is the Orcish castle!";
88
}
9-
9+
1010
}

abstract-factory/src/main/java/com/iluwatar/OrcKing.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ public class OrcKing implements King {
66
public String toString() {
77
return "This is the Orc king!";
88
}
9-
9+
1010
}

abstract-factory/src/main/java/com/iluwatar/OrcKingdomFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
*
55
* Concrete factory.
6-
*
6+
*
77
*/
88
public class OrcKingdomFactory implements KingdomFactory {
99

0 commit comments

Comments
 (0)