BeforeRule class
Represents a reordering rule for property sources that ensures one source appears before another within a list of PropertySources.
This class is typically used with a property source container, such as MutablePropertySources, to dynamically reorder sources according to user-defined precedence rules.
Usage
final rule = BeforeRule('env', 'defaults');
final reordered = rule.apply(sourcesList);
In the example above:
- The source named
'env'will be moved to appear before the source named'defaults'. - If either source is not found, the original order is preserved.
- Implemented types
Constructors
- BeforeRule(String before, String after)
-
Represents a reordering rule for property sources that ensures
one source appears before another within a list of PropertySources.
const
Properties
- after → String
-
The name of the property source that should appear after before.
final
- before → String
-
The name of the property source that should appear before another.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- 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