Guest User

Untitled

a guest
Sep 17th, 2020
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.67 KB | None | 0 0
  1.  
  2. public abstract class AbstractExecutor {
  3.  
  4.     private final Service1 service1;
  5.     private final Service2 service2;
  6.     private final Service3 service3;
  7.  
  8.     AbstractExecutor(Service1 service1, Service2 service2, Service3 service3) {
  9.         this.service1 = service1;
  10.         this.service2 = service2;
  11.         this.service3 = service3;
  12.     }
  13.  
  14.  
  15.     public void execute() {
  16.         service1.do();
  17.         specificMethod();
  18.         if (isSomething()) {
  19.             service2.do();
  20.         }
  21.         specificMethod2();
  22.         service3.do();
  23.     }
  24.  
  25.     abstract String specificMethod();
  26.     abstract String specificMethod2();
  27.     abstract boolean isSomething();
  28. }
Advertisement
Add Comment
Please, Sign In to add comment