Skip to content

Instantly share code, notes, and snippets.

@yinonavraham
Created February 21, 2017 21:22
Show Gist options
  • Save yinonavraham/0a9c4b72fd291a17e469d463a10f555f to your computer and use it in GitHub Desktop.
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
public interface AB extends A {
String bar();
}
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