是否有一些模板或其他东西来实现访问被包装成员的 iterface 方法?
例如,假设我有
public class MyClass implements List<Something> {
private final List<Something> core;
...
}
现在我想实现 List<Something>
通过将调用传递给 Wrapped like
@Override
public int size() {
return core.size();
}
等等。
最佳答案
有。使用 Source 菜单->Generate Delegate Methods...
关于java - 在 Eclipse 中快速实现包装(委托(delegate)方法)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15397108/