removes the Citizen class in src directory.
changes messages printed by the secretary and the president.
This commit is contained in:
parent
5d790266e7
commit
e30d11545f
@ -1,11 +0,0 @@
|
||||
package com.designpatterns.structural.proxy;
|
||||
|
||||
import com.designpatterns.structural.proxy.president.PresidentSecretary;
|
||||
|
||||
public class Citizen {
|
||||
|
||||
public static void main(String[] args) {
|
||||
PresidentSecretary presidentSecretary = new PresidentSecretary();
|
||||
presidentSecretary.leaveValidMessageForPresident("Hello president.");
|
||||
}
|
||||
}
|
@ -22,6 +22,6 @@ public class President {
|
||||
|
||||
|
||||
void talkToThePresident(String message){
|
||||
System.out.println("I, the President, have received this message:" + message);
|
||||
System.out.println("President: I have received the message:" + message);
|
||||
}
|
||||
}
|
||||
|
@ -13,9 +13,9 @@ public class PresidentSecretary {
|
||||
if(!isMessageValid(message))
|
||||
throw new RuntimeException("invalid message");
|
||||
|
||||
System.out.println("message is being sent to the President...");
|
||||
System.out.println("Secretary: message is being sent to the President...");
|
||||
president.talkToThePresident(message);
|
||||
System.out.println("message is received by the President.");
|
||||
System.out.println("Secretary: message is sent to the President.");
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user