forked from mastifikator/FantasyJavaPatterns
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLord.java
More file actions
36 lines (28 loc) · 765 Bytes
/
Copy pathLord.java
File metadata and controls
36 lines (28 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package Proxy;
public class Lord implements IReply{
private String name;
private boolean noble = true;
public Lord(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public boolean isNoble() {
return noble;
}
public void setNoble(boolean noble) {
this.noble = noble;
}
@Override
public void replyToRequest(String request){
if(request.matches(".*Ваше благородие.*")){
System.out.println("Твой запрос будет удовлетворен");
}else{
System.out.println("Пошел вон, смерд!");
}
}
}