Created
February 21, 2017 21:22
-
-
Save yinonavraham/0a9c4b72fd291a17e469d463a10f555f to your computer and use it in GitHub Desktop.
Part of the following post in orange-coding.blogspot.com: Enhancing (extending) a class using dynamic proxy classes in Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface AB extends A { | |
String bar(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ABDecorator implements AB { | |
private final A delegate; | |
public ABDecorator(A a) { | |
this.delegate = a; | |
} | |
public String foo() { | |
return this.delegate.foo(); | |
} | |
public String bar() { | |
return "bar "; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment