mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-15 10:58:51 +00:00
added chain of responsibility sample
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
package com.iluwatar;
|
||||
|
||||
public class Request {
|
||||
|
||||
private String requestDescription;
|
||||
private RequestType requestType;
|
||||
|
||||
public Request(RequestType requestType, String requestDescription) {
|
||||
this.setRequestType(requestType);
|
||||
this.setRequestDescription(requestDescription);
|
||||
}
|
||||
|
||||
public String getRequestDescription() {
|
||||
return requestDescription;
|
||||
}
|
||||
|
||||
public void setRequestDescription(String requestDescription) {
|
||||
this.requestDescription = requestDescription;
|
||||
}
|
||||
|
||||
public RequestType getRequestType() {
|
||||
return requestType;
|
||||
}
|
||||
|
||||
public void setRequestType(RequestType requestType) {
|
||||
this.requestType = requestType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getRequestDescription();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user