Joost Klitsie
02/16/2026, 8:26 AMChrimaeon
02/16/2026, 8:45 AMJoost Klitsie
02/16/2026, 8:47 AMJoost Klitsie
02/16/2026, 8:49 AMRobert Jaros
02/16/2026, 10:35 AMJoost Klitsie
02/16/2026, 10:38 AMJoost Klitsie
02/16/2026, 11:26 AM@Single provideHttpClient(json: Json): HttpClient = .... but it is also doable with simpler objects:
interface ExampleObject {
fun getString(): String
}
@Single(binds = [DefaultExampleObject::class, ExampleObject::class])
class DefaultExampleObject() : ExampleObject {
override fun getString(): String {
return "I am a string"
}
}
@Module
@Configuration
@ComponentScan
class ExampleModule {
@Single
fun brokenDefaultExampleObject(exampleObject: DefaultExampleObject): Int = 5
@Single
fun correctExampleObject(exampleObject: ExampleObject): String = exampleObject.getString()
}bashor
02/16/2026, 1:52 PMJoost Klitsie
02/16/2026, 2:29 PM