Guest User

Untitled

a guest
Jun 23rd, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. public class YouCanNotChangeMe_IAmNotYours{
  2. public void doSomethingSpecial();
  3. }
  4.  
  5. public interface MyInterface{
  6. void doSomethingSpecial();
  7. }
  8.  
  9. public class ForeignClassWrapper implements MyInterface {
  10. private final YouCanNotChangeMe_IAmNotYours delegate;
  11.  
  12. public ForeignClassWrapper(YouCanNotChangeMe_IAmNotYours delegate) {
  13. this.delegate = delegate;
  14. }
  15.  
  16. public void doSomethingSpecial() {
  17. delegate.doSomethingSpecial();
  18. }
  19. }
Add Comment
Please, Sign In to add comment