Qualifier class

Picks one bean among several of the same type, by a label or a bean name.

On a bean declaration it gives the bean that label. On an injection point it selects the bean with that label or name. Use it when several beans share a type and the one to inject is not the Primary one.

@Component()
@Qualifier('fr')
class FrenchGreeter implements Greeter { ... }

// This page is French, whatever the default greeter is.
@Service()
class Welcome {
  Welcome(@Qualifier('fr') this.greeter);
  final Greeter greeter;
}

Spring (Java):

@Component
@Qualifier("fr")
class FrenchGreeter implements Greeter { ... }

@Service
class Welcome {
  Welcome(@Qualifier("fr") Greeter greeter) { ... }
}

Constructors

Qualifier(String value)
Labels the bean, or selects one at an injection point, with value.
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
value → String
The label or bean name.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited