ContributesBinding
Contributes a binding of the annotated type to the given scope as a binding (if specified) or single declared supertype.
// Implicit supertype is Base
@ContributesBinding(AppScope::class)
@Inject
class Impl : BaseUse binding to specify a specific bound type if an implicit one is not possible.
// Explicit supertype is Base
@ContributesBinding(AppScope::class, binding = binding<Base>())
@Inject
class Impl : Base, AnotherBaseThis annotation is repeatable, allowing the annotated type to contribute to multiple scopes, as multiple bound types, or both.
If this declaration is scoped, the Scope annotation will be propagated to the generated Binds declaration.
If this declaration is qualified, the Qualifier annotation will be propagated to the generated Binds declaration.
Properties
The priority of this binding relative to other contributions for the same qualified bound type. The highest-priority contribution is used. Contributions with the same priority remain duplicate bindings. Defaults to Int.MIN_VALUE.