Qualifier class

Qualifier annotation for specific bean selection

When multiple beans of the same type are available, use @Qualifier to specify which specific bean should be injected.

Example:

@Service()
@Qualifier('primary')
class PrimaryUserService implements UserService { }

@Service()
@Qualifier('secondary')
class SecondaryUserService implements UserService { }

@Component()
class UserController {
  @Autowired()
  @Qualifier('primary')
  late UserService userService;
}

Constructors

Qualifier(String 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 qualifier name to distinguish beans
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