ContributesIntoMap
Contributes an IntoMap binding of the annotated type to the given scope as a binding (if specified) or single declared supertype. A MapKey must be declared either on the annotated class or on the binding.
// Implicit supertype is Base
@ClassKey(Impl::class)
@ContributesIntoMap(AppScope::class)
@Inject
class Impl : BaseUse binding to specify a specific bound type if an implicit one is not possible.
// Explicit supertype is Base
@ClassKey(Impl::class)
@ContributesIntoMap(AppScope::class, binding = binding<Base>())
@Inject
class Impl : Base, AnotherBasebinding's type argument can also be annotated with a MapKey.
// Explicit supertype is Base
@ContributesIntoMap(AppScope::class, binding = binding<@ClassKey(Impl::class) Base>())
@Inject
class Impl : Base, AnotherBaseThis annotation is repeatable, allowing for contributions as multiple bound types. Note that all repeated annotations must use the same scope.
If this declaration is scoped, the Scope annotation will be propagated to the generated IntoMap declaration.
If this declaration is qualified, the Qualifier annotation will be propagated to the generated IntoMap declaration.
Properties
The priority of this binding relative to other contributions for the same qualified map and map-key value. The highest-priority contribution is used. Contributions with the same priority remain duplicate map entries. Defaults to Int.MIN_VALUE.