AnnotationQualifier

class AnnotationQualifier(val annotation: KClass<out Annotation>) : Qualifier

A Qualifier that uses an Annotation class as a unique identifier. This allows for creating custom, type-safe qualifiers for dependency injection.

Example usage:

// 1. Define a custom annotation
annotation class ApiService

// 2. Register a dependency with the annotation qualifier
single(annotated<ApiService>()) { Retrofit.create(MyApi::class.java) }

// 3. Inject the dependency
val myApi: MyApi by scope.inject(annotated<ApiService>())

Constructors

Link copied to clipboard
constructor(annotation: KClass<out Annotation>)

Properties

Link copied to clipboard

The KClass of the annotation used for identification.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String