如何扩展具有泛型参数的以下抽象类?
@Singleton
public abstract class Presenter<V extends View, Proxy_ extends Proxy<?>> extends PresenterWidget<V> {
...
}
答案 0 :(得分:0)
班级Presenter
简化了通用类型Presenter<V, Proxy_>
,其中
V
扩展View
Proxy_
扩展Proxy<?>
扩展类应如下所示:
public class MyPresenter extends Presenter<MyView, MyProxy> {
...
}
,其中
MyView
扩展View
MyProxy
扩展Proxy<?>
答案 1 :(得分:0)
扩展MariuszS的答案:通常,演示者定义视图界面:
public class MyPresenter extends Presenter<MyPresenter.MyView, MyProxy> {
public static interface MyView extends View {
...
}
...