Java 如何在Kotlin中编写Dagger组件?
我是dagger和kotlin语言的新手,我想把下面的java代码翻译成kotlin代码。这是用java编写的dagger组件Java 如何在Kotlin中编写Dagger组件?,java,kotlin,dagger-2,Java,Kotlin,Dagger 2,我是dagger和kotlin语言的新手,我想把下面的java代码翻译成kotlin代码。这是用java编写的dagger组件 @Singleton @Component(modules = {ApplicationModule.class, NetworkingModule.class}) public interface ApplicationComponent { public PresentationComponent newPresentation
@Singleton
@Component(modules = {ApplicationModule.class, NetworkingModule.class})
public interface ApplicationComponent {
public PresentationComponent newPresentationComponent(PresentationModule presentationModule);
}
可能是这样,
@Singleton
@Component(modules = [ApplicationModule::class, NetworkingModule::class])
interface ApplicationComponent {
fun newPresentationComponent(PresentationModule presentationModule): PresentationComponent
}