Interface for registries that hold PodDefinition instances.
This abstraction represents the core contract for managing the registration, lookup, and removal of pod definitions in a dependency injection container or application context.
Framework components or configuration processors can interact with this interface to introspect or programmatically register pods without requiring concrete knowledge of the underlying implementation.
Example
class MyRegistry implements PodDefinitionRegistry {
final Map<String, PodDefinition> _definitions = {};
@override
void registerDefinition(String name, PodDefinition podDefinition) {
_definitions[name] = podDefinition;
}
@override
void removeDefinition(String name) {
_definitions.remove(name);
}
@override
PodDefinition getDefinition(String name) {
return _definitions[name]!;
}
@override
bool containsDefinition(String name) => _definitions.containsKey(name);
@override
List<String> getDefinitionNames() => _definitions.keys.toList();
@override
int getDefinitionCount() => _definitions.length;
@override
bool isNameInUse(String name) => _definitions.containsKey(name);
}
- Implemented types
- Implementers
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
-
containsDefinition(
String name) → bool -
Returns
trueif this registry contains a pod with the givenname.inherited -
getDefinition(
String name) → PodDefinition -
Retrieve the pod registered under
name. -
getDefinitionByClass(
Class type) → PodDefinition - Returns the pod definition for the specified class type.
-
getDefinitionNames(
) → List< String> -
Returns a list of all pod names currently registered.
inherited
-
getNumberOfPodDefinitions(
) → int -
Returns the total number of pods registered.
inherited
-
isNameInUse(
String name) → Future< bool> -
Returns
trueifnameis currently in use in this registry. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerDefinition(
String name, PodDefinition pod) → Future< void> -
Register a new
podunder the givenname. -
removeDefinition(
String name) → Future< void> -
Remove the pod associated with
name. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited