Priority class
Ranks a bean among others of the same type: the JSR-250 annotation
jakarta.annotation.Priority, on a bean class (or @Bean method).
It does two jobs. Among several candidates for an injection point or a
getBean<T>() without a primary or name match, the one with the lowest
value wins (two with that value are ambiguous). And it orders beans in
collections and listeners when they have neither Ordered nor
@Order, like Spring's AnnotationAwareOrderComparator. @Primary()
and @Order cover the same needs in Spring style.
import 'package:spring_core_dart/jakarta.dart' as jakarta;
@Component()
@jakarta.Priority(1)
class FastStore implements Store { ... }
@Component()
@jakarta.Priority(5)
class SlowStore implements Store { ... }
// Store is FastStore; List<Store> is [FastStore, SlowStore].
Spring (Java):
@Component @Priority(1) class FastStore implements Store { ... }
Properties
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