PodNameGenerator class abstract interface

Strategy interface for generating pod names for PodDefinitions.

Frameworks that manage pods or dependency injection containers can use this interface to determine the default name to assign to a pod definition if no explicit name is provided.

This abstraction decouples naming logic from the core registration mechanism, allowing different naming strategies to be plugged in (e.g., based on class names, annotations, metadata, or hashing).

Example

class SimpleNameGenerator implements PodNameGenerator {
  @override
  String generate(PodDefinition definition, PodDefinitionRegistry registry) {
    return definition.name.toLowerCase();
  }
}

void main() {
  final definition = PodDefinition('MyService', Class<MyService>());
  final registry = MyPodDefinitionRegistry();
  final generator = SimpleNameGenerator();
  print(generator.generate(definition, registry)); // Output: myservice
}
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

generate(PodDefinition definition, PodDefinitionRegistry registry) String
Strategy interface for generating pod names for PodDefinitions.
getPackageName() String
Represents an abstraction for identifying the package that an object, resource, or service belongs to.
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