ListablePropertySource<T> class
abstract
A specialized PropertySource capable of enumerating all available property keys, allowing efficient lookup operations.
Unlike generic property sources, this class supports retrieval of all known property names through getPropertyNames. This makes methods like containsProperty fast and lightweight, as they can check membership without calling getProperty.
Framework-level sources like environment variables, maps, or configuration files often extend this class to benefit from key enumeration.
Example:
class MapPropertySource extends ListablePropertySource<Map<String, Object>> {
MapPropertySource(super.name, super.source);
@override
List<String> getPropertyNames() => source.keys.toList();
@override
Object? getProperty(String name) => source[name];
}
- Inheritance
-
- Object
- PropertySource<
T> - ListablePropertySource
- Implementers
- Annotations
-
- @Generic.new(ListablePropertySource)
Constructors
- ListablePropertySource(String name, T source)
- A specialized PropertySource capable of enumerating all available property keys, allowing efficient lookup operations.
- ListablePropertySource.named(String name)
- A specialized PropertySource capable of enumerating all available property keys, allowing efficient lookup operations.
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 → T
-
The underlying object that holds the raw property data.
finalinherited
Methods
-
containsProperty(
String name) → bool -
Returns
true
if this property source contains the givenname
.override -
equalizedProperties(
) → List< Object?> -
Mixin-style contract for value-based equality,
hashCode
, andtoString
.inherited -
getName(
) → String -
Returns the name of this property source.
inherited
-
getProperty(
String name) → Object? -
Retrieves the value associated with the given
name
, ornull
if not present.inherited -
getPropertyNames(
) → List< String> - Returns the full list of property names known to this PropertySource.
-
getSource(
) → T -
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.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited