I have a class
class Foo {
int increment(int x) {
return x + 1;
}
}
I want to obtain a copy of this class in runtime, e. g. a class like
class Foo$Copy1 {
int increment(int x) {
return x + 1;
}
}
Which has all the same methods, but a different name.
Proxy
seem to help with delegating, but not copying the methods with all their bodies.