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
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

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 a value for the given property name.
override
equalizedProperties() → List<Object?>
Mixin-style contract for value-based equality, hashCode, and toString.
inherited
getName() → String
Returns the unique, human-readable name of this property source.
inherited
getProperty(String name) → Object?
Retrieves the value associated with the given property name, or null if the property is not present in this source.
override
getPropertyNames() → List<String>
Returns the full list of property names known to this PropertySource.
override
getPropertySources() → List<PropertySource>
Returns a snapshot list of all PropertySource instances contained within this composite.
getSource() → Object
Returns the underlying source object from which property data is retrieved.
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