Skip to content

Commit e30d115

Browse files
committed
removes the Citizen class in src directory.
changes messages printed by the secretary and the president.
1 parent 5d79026 commit e30d115

File tree

3 files changed

+3
-14
lines changed

3 files changed

+3
-14
lines changed

src/main/java/com/designpatterns/structural/proxy/Citizen.java

-11
This file was deleted.

src/main/java/com/designpatterns/structural/proxy/president/President.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ static President getInstance() {
2222

2323

2424
void talkToThePresident(String message){
25-
System.out.println("I, the President, have received this message:" + message);
25+
System.out.println("President: I have received the message:" + message);
2626
}
2727
}

src/main/java/com/designpatterns/structural/proxy/president/PresidentSecretary.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ public void leaveValidMessageForPresident(String message){
1313
if(!isMessageValid(message))
1414
throw new RuntimeException("invalid message");
1515

16-
System.out.println("message is being sent to the President...");
16+
System.out.println("Secretary: message is being sent to the President...");
1717
president.talkToThePresident(message);
18-
System.out.println("message is received by the President.");
18+
System.out.println("Secretary: message is sent to the President.");
1919

2020
}
2121

0 commit comments

Comments
 (0)