Resolve All
annotation class ResolveAll
Resolve all matching values, e.g. multiple implementations of the same interface
The annotated parameter has to have type List<T> where T is the type you want to resolve.
interface SomeInterface
class ImplementationOne : SomeInterface
class ImplementationTwo : SomeInterface
class DependsOnImplementations(
@ResolveAll val allImplementations: List<SomeInterface>
)
val context = resolveDependencies(
ImplementationOne::class,
ImplementationTwo::class,
DependsOnImplementations::class
)Content copied to clipboard