CompositePropertySource class

A composite implementation of ListablePropertySource that aggregates multiple PropertySource instances.

This class allows you to group multiple property sources under a single logical name. When resolving properties, the sources are checked in the order they were added.

Example:

var composite = CompositePropertySource('applicationConfig');
composite.addPropertySource(MapPropertySource('map1', {'foo': 'bar'}));
composite.addPropertySource(SystemEnvironmentPropertySource('env'));
var value = composite.getProperty('foo'); // searches map1 first, then env
Inheritance

Constructors

CompositePropertySource(String name)
A composite implementation of ListablePropertySource that aggregates multiple PropertySource instances.

Properties

hashCode int
The hash code for this object.
no setterinherited
name String
The unique name that identifies this property source. Typically used for logging, debugging, and source resolution order.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
source Object
The underlying object that holds the raw property data.
finalinherited

Methods

addFirstPropertySource(PropertySource propertySource) → void
Adds the given propertySource to the start of the composite chain.
addPropertySource(PropertySource propertySource) → void
Adds the given propertySource to the end of the composite chain.
containsProperty(String name) bool
Returns true if this property source contains the given name.
override
equalizedProperties() List<Object?>
Mixin-style contract for value-based equality, hashCode, and toString.
inherited
getName() String
Returns the name of this property source.
inherited
getProperty(String name) Object?
Retrieves the value associated with the given name, or null if not present.
override
getPropertyNames() List<String>
Returns the full list of property names known to this PropertySource.
override
getPropertySources() List<PropertySource>
Returns all PropertySource instances currently contained in this composite.
getSource() Object
Returns the underlying source object.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

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