samplest.hello.FactoryInjectionResource.kt Maven / Gradle / Ivy
package samplest.hello
import restx.annotations.GET
import restx.annotations.RestxResource
import restx.factory.Component
@Component
@RestxResource("/factory")
class FactoryInjectionResource(
private val testSetInjection: Set,
private val testSetAbstract: Set
) {
@GET("/interface/set")
fun testInterfaceSet(): Set = testSetInjection.map { it.javaClass.name }.toSet()
@GET("/abstract/set")
fun testAbstractSet(): Set = testSetAbstract.map { it.javaClass.name }.toSet()
}
interface TestSetInjection
@Component
class TestSetInjectionImpl01 : TestSetInjection
@Component
class TestSetInjectionImpl02 : TestSetInjection
abstract class TestSetAbstract
@Component
class TestSetAbstractImpl01 : TestSetAbstract()
@Component
class TestSetAbstractImpl02 : TestSetAbstract()