Skip to content

Commit 7461131

Browse files
committed
rename
1 parent 9de3cea commit 7461131

File tree

13 files changed

+57
-57
lines changed

13 files changed

+57
-57
lines changed

src/main/java/helloworld/Main.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ public static void main(String[] args) throws InstantiationException, IllegalAcc
3939
System.out.println("We are creational patterns!");
4040

4141
SplitHelloWorldFactory abstractFactory = AbstractFactory.select(AbstractFactory.Type.DesignPattern);
42-
HelloWorld abstractFactoryHelloWorld = new SplitHelloWorld(abstractFactory.createHelloWorldSlogan(),
43-
abstractFactory.createHelloWorldTarget());
42+
HelloWorld abstractFactoryHelloWorld = new SplitHelloWorld(abstractFactory.createHelloWorldInterjection(),
43+
abstractFactory.createHelloWorldObject());
4444
System.out.println(abstractFactoryHelloWorld.helloWorld());
4545

4646
HelloWorld builderHelloWorld = HelloWorldBuilder.builder()
47-
.slogan("Hello")
48-
.target("Builder").getHelloWorld();
47+
.interjection("Hello")
48+
.object("Builder").getHelloWorld();
4949
System.out.println(builderHelloWorld.helloWorld());
5050

5151
/**
@@ -103,12 +103,12 @@ public static void main(String[] args) throws InstantiationException, IllegalAcc
103103
}
104104
System.out.println();
105105

106-
HelloWorldInterjection helloWorldSlogan = new HelloWorldInterjection();
107-
HelloWorldObject helloWorldTarget = new HelloWorldObject();
108-
HelloWorldMediator helloWorldMediator = new HelloWorldMediator(helloWorldSlogan,helloWorldTarget);
109-
helloWorldSlogan.setHelloWorldMediator(helloWorldMediator);
110-
helloWorldTarget.setHelloWorldMediator(helloWorldMediator);
111-
System.out.println(helloWorldTarget.helloWorld());
106+
HelloWorldInterjection helloWorldInterjection = new HelloWorldInterjection();
107+
HelloWorldObject helloWorldObject = new HelloWorldObject();
108+
HelloWorldMediator helloWorldMediator = new HelloWorldMediator(helloWorldInterjection,helloWorldObject);
109+
helloWorldInterjection.setHelloWorldMediator(helloWorldMediator);
110+
helloWorldObject.setHelloWorldMediator(helloWorldMediator);
111+
System.out.println(helloWorldObject.helloWorld());
112112

113113
HelloWorldMementoOriginator helloWorldMementoOriginator = new HelloWorldMementoOriginator();
114114
HelloWorldMementoOriginator.Memento memento = helloWorldMementoOriginator.set("Hello Memento!").saveToMemento();

src/main/java/helloworld/SplitHelloWorld.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,23 @@ public SplitHelloWorld(HelloWorldInterjection helloWorldInterjection, HelloWorld
2222

2323
@Override
2424
public String helloWorld() {
25-
return helloWorldInterjection.slogan() + separator + helloWorldObject.target() + terminator;
25+
return helloWorldInterjection.interjection() + separator + helloWorldObject.object() + terminator;
2626
}
2727

2828
public interface HelloWorldInterjection {
2929

30-
public String slogan();
30+
public String interjection();
3131
}
3232

3333
public interface HelloWorldObject {
3434

35-
public String target();
35+
public String object();
3636
}
3737

3838
public static class DefaultInterjection implements HelloWorldInterjection {
3939

4040
@Override
41-
public String slogan() {
41+
public String interjection() {
4242
return "Hello";
4343
}
4444
}

src/main/java/helloworld/behavioral/mediator/HelloWorldInterjection.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ public void setHelloWorldMediator(HelloWorldMediator helloWorldMediator) {
1919
}
2020

2121
@Override
22-
public String slogan() {
22+
public String interjection() {
2323
return "Hello";
2424
}
2525

2626
@Override
2727
public String helloWorld() {
28-
return slogan() + separator + helloWorldMediator.target() + terminator;
28+
return interjection() + separator + helloWorldMediator.object() + terminator;
2929
}
3030
}

src/main/java/helloworld/behavioral/mediator/HelloWorldMediator.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ public HelloWorldMediator(SplitHelloWorld.HelloWorldInterjection helloWorldInter
1616
this.helloWorldObject = helloWorldObject;
1717
}
1818

19-
public String slogan() {
20-
return helloWorldInterjection.slogan();
19+
public String interjection() {
20+
return helloWorldInterjection.interjection();
2121
}
2222

23-
public String target() {
24-
return helloWorldObject.target();
23+
public String object() {
24+
return helloWorldObject.object();
2525
}
2626

2727
}

src/main/java/helloworld/behavioral/mediator/HelloWorldObject.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ public void setHelloWorldMediator(HelloWorldMediator helloWorldMediator) {
1919
}
2020

2121
@Override
22-
public String target() {
22+
public String object() {
2323
return "Mediator";
2424
}
2525

2626
@Override
2727
public String helloWorld() {
28-
return helloWorldMediator.slogan() + separator + target() + terminator;
28+
return helloWorldMediator.interjection() + separator + object() + terminator;
2929
}
3030
}

src/main/java/helloworld/creational/abstract_factory/DesignPatternSplitHelloWorldFactory.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@
88
public class DesignPatternSplitHelloWorldFactory implements SplitHelloWorldFactory {
99

1010
@Override
11-
public SplitHelloWorld.HelloWorldInterjection createHelloWorldSlogan() {
11+
public SplitHelloWorld.HelloWorldInterjection createHelloWorldInterjection() {
1212
return new SplitHelloWorld.DefaultInterjection();
1313
}
1414

1515
@Override
16-
public SplitHelloWorld.HelloWorldObject createHelloWorldTarget() {
16+
public SplitHelloWorld.HelloWorldObject createHelloWorldObject() {
1717
return new DesignPatternHelloWorldObject();
1818
}
1919

2020
class DesignPatternHelloWorldObject implements SplitHelloWorld.HelloWorldObject {
2121

2222
@Override
23-
public String target() {
23+
public String object() {
2424
return "Abstract Factory";
2525
}
2626
}

src/main/java/helloworld/creational/abstract_factory/JavaSplitHelloWorldFactory.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@
88
public class JavaSplitHelloWorldFactory implements SplitHelloWorldFactory {
99

1010
@Override
11-
public SplitHelloWorld.HelloWorldInterjection createHelloWorldSlogan() {
11+
public SplitHelloWorld.HelloWorldInterjection createHelloWorldInterjection() {
1212
return new SplitHelloWorld.DefaultInterjection();
1313
}
1414

1515
@Override
16-
public SplitHelloWorld.HelloWorldObject createHelloWorldTarget() {
16+
public SplitHelloWorld.HelloWorldObject createHelloWorldObject() {
1717
return new JavaHelloWorldObject();
1818
}
1919

2020
class JavaHelloWorldObject implements SplitHelloWorld.HelloWorldObject {
2121

2222
@Override
23-
public String target() {
23+
public String object() {
2424
return "Java";
2525
}
2626
}

src/main/java/helloworld/creational/abstract_factory/SplitHelloWorldFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88
public interface SplitHelloWorldFactory {
99

10-
public SplitHelloWorld.HelloWorldInterjection createHelloWorldSlogan();
10+
public SplitHelloWorld.HelloWorldInterjection createHelloWorldInterjection();
1111

12-
public SplitHelloWorld.HelloWorldObject createHelloWorldTarget();
12+
public SplitHelloWorld.HelloWorldObject createHelloWorldObject();
1313
}

src/main/java/helloworld/creational/builder/HelloWorldBuilder.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,34 +8,34 @@
88
*/
99
public class HelloWorldBuilder {
1010

11-
private String slogan;
11+
private String interjection;
1212

13-
private String target;
13+
private String object;
1414

1515
public static HelloWorldBuilder builder() {
1616
return new HelloWorldBuilder();
1717
}
1818

19-
public HelloWorldBuilder slogan(String slogan) {
20-
this.slogan = slogan;
19+
public HelloWorldBuilder interjection(String interjection) {
20+
this.interjection = interjection;
2121
return this;
2222
}
2323

24-
public HelloWorldBuilder target(String target) {
25-
this.target = target;
24+
public HelloWorldBuilder object(String object) {
25+
this.object = object;
2626
return this;
2727
}
2828

2929
public HelloWorld getHelloWorld() {
3030
return new SplitHelloWorld(new SplitHelloWorld.HelloWorldInterjection() {
3131
@Override
32-
public String slogan() {
33-
return slogan;
32+
public String interjection() {
33+
return interjection;
3434
}
3535
}, new SplitHelloWorld.HelloWorldObject() {
3636
@Override
37-
public String target() {
38-
return target;
37+
public String object() {
38+
return object;
3939
}
4040
});
4141
}

src/main/java/helloworld/structural/facade/HelloWorldFacade.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ private static class HelloWorldFacadeInstanceHolder {
2424

2525
public HelloWorld facadeHelloWorld(){
2626
return HelloWorldBuilder.builder()
27-
.slogan("Hello")
28-
.target("Facade").getHelloWorld();
27+
.interjection("Hello")
28+
.object("Facade").getHelloWorld();
2929
}
3030

3131
}

src/test/java/helloworld/behavioral/mediator/HelloWorldMediatorTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ public class HelloWorldMediatorTest {
1111

1212
@Test
1313
public void testHelloWorldMediator(){
14-
HelloWorldInterjection helloWorldSlogan = new HelloWorldInterjection();
15-
HelloWorldObject helloWorldTarget = new HelloWorldObject();
16-
HelloWorldMediator helloWorldMediator = new HelloWorldMediator(helloWorldSlogan,helloWorldTarget);
17-
helloWorldSlogan.setHelloWorldMediator(helloWorldMediator);
18-
helloWorldTarget.setHelloWorldMediator(helloWorldMediator);
19-
assertThat(helloWorldSlogan.helloWorld(),is("Hello Mediator!"));
20-
assertThat(helloWorldTarget.helloWorld(),is("Hello Mediator!"));
14+
HelloWorldInterjection helloWorldInterjection = new HelloWorldInterjection();
15+
HelloWorldObject helloWorldObject = new HelloWorldObject();
16+
HelloWorldMediator helloWorldMediator = new HelloWorldMediator(helloWorldInterjection,helloWorldObject);
17+
helloWorldInterjection.setHelloWorldMediator(helloWorldMediator);
18+
helloWorldObject.setHelloWorldMediator(helloWorldMediator);
19+
assertThat(helloWorldInterjection.helloWorld(),is("Hello Mediator!"));
20+
assertThat(helloWorldObject.helloWorld(),is("Hello Mediator!"));
2121
}
2222
}

src/test/java/helloworld/creational/abstract_factory/AbstractFactoryTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ public class AbstractFactoryTest {
1515
@Test
1616
public void testHelloWorld() throws InstantiationException, IllegalAccessException {
1717
SplitHelloWorldFactory splitHelloWorldFactory = AbstractFactory.select(AbstractFactory.Type.Java);
18-
assertThat(splitHelloWorldFactory.createHelloWorldTarget().target(), is("Java"));
19-
assertThat(splitHelloWorldFactory.createHelloWorldSlogan().slogan(), is("Hello"));
18+
assertThat(splitHelloWorldFactory.createHelloWorldObject().object(), is("Java"));
19+
assertThat(splitHelloWorldFactory.createHelloWorldInterjection().interjection(), is("Hello"));
2020
splitHelloWorldFactory = AbstractFactory.select(AbstractFactory.Type.DesignPattern);
21-
assertThat(splitHelloWorldFactory.createHelloWorldSlogan().slogan(), is("Hello"));
22-
assertThat(splitHelloWorldFactory.createHelloWorldTarget().target(), is("Abstract Factory"));
21+
assertThat(splitHelloWorldFactory.createHelloWorldInterjection().interjection(), is("Hello"));
22+
assertThat(splitHelloWorldFactory.createHelloWorldObject().object(), is("Abstract Factory"));
2323
}
2424

2525
}

src/test/java/helloworld/creational/builder/HelloWorldBuilderTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ public class HelloWorldBuilderTest {
1313
@Test
1414
public void testHelloWorldBuilder(){
1515
HelloWorld builderHelloWorld = HelloWorldBuilder.builder()
16-
.slogan("Hello")
17-
.target("Builder").getHelloWorld();
16+
.interjection("Hello")
17+
.object("Builder").getHelloWorld();
1818
assertThat(builderHelloWorld.helloWorld(),is("Hello Builder!"));
1919

2020
HelloWorld helloWorld = HelloWorldBuilder.builder()
21-
.slogan("Hello")
22-
.target("World").getHelloWorld();
21+
.interjection("Hello")
22+
.object("World").getHelloWorld();
2323
assertThat(helloWorld.helloWorld(),is("Hello World!"));
2424
}
2525
}

0 commit comments

Comments
 (0)