named
Assign a string-based qualifier to this definition. Used within withOptions { } block.
Parameters
name
The string name to use as qualifier
Example:
single { MyService() } withOptions {
named("production")
}
// Retrieve with: get(qualifier = named("production"))Content copied to clipboard
Assign a type-based qualifier to this definition. Used within withOptions { } block.
The qualifier will be based on the reified type T.
Example:
single { MyService() } withOptions {
named<ProductionQualifier>()
}
// Retrieve with: get(qualifier = named<ProductionQualifier>())Content copied to clipboard