PriorityRule class
A reordering rule for property sources based on explicit numeric priorities.
Each property source name can be assigned an integer priority.
- Lower numbers indicate higher precedence.
- Sources not listed in priorities default to a low priority (e.g., 1000) and appear later.
This rule is typically applied to a list of PropertySources to produce a deterministic ordering according to user-defined priorities.
Example
final rule = PriorityRule({'env': 1, 'defaults': 10});
final reordered = rule.apply(sourcesList);
In this example, 'env' will be moved before 'defaults' regardless of
their original positions in the list.
- Implemented types
Constructors
-
PriorityRule(Map<
String, int> priorities) -
A reordering rule for property sources based on explicit numeric priorities.
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
priorities
→ Map<
String, int> -
A mapping from property source names to their integer priority.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
apply(
List< PropertySource> sources) → List<PropertySource> -
Applies this ordering rule to the provided list of
`PropertySource`s.override -
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