All Downloads are FREE. Search and download functionalities are using the official Maven repository.

samplest.hello.FactoryInjectionResource.kt Maven / Gradle / Ivy

There is a newer version: 1.2.0-rc2
Show newest version
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()




© 2015 - 2024 Weber Informatics LLC | Privacy Policy