如何在Kotlin中实现具有几个通用参数的类?

时间:2019-09-02 15:18:05

标签: kotlin

这是我的Java类。如何在Kotlin上写它?

public class TargetTitleEntryController extends BaseController {

    public interface TargetTitleEntryControllerListener {
        void onTitlePicked(String option);
    }

    public <T extends Controller & TargetTitleEntryControllerListener> TargetTitleEntryController(T targetController) {
        setTargetController(targetController);
    }

    public TargetTitleEntryController() { }
}

1 个答案:

答案 0 :(得分:0)

我是这样class SecondController<T> : Controller() where T: Controller, T: SecondController.SecondControllerListener