Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package chainofresponsibility.model.handler;
- public abstract class Handler {
- private Handler next;
- public Handler (){
- }
- public Handler (Handler next){
- this.next = next;
- }
- public void handleRequest (){
- if (this.next != null){
- this.next.handleRequest();
- }
- this.start();
- }
- public abstract void start();
- public Handler setNext(Handler next){
- this.next = next;
- return this.next;
- }
- public Handler getNext (){
- return this.next;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement