# getPodNamesForAnnotation<A> method

1. @override

Future<List<String>> getPodNamesForAnnotation<A>(

1. Class<A> type

)
override

Retrieves pod names for pods annotated with the specified annotation type.

This method is useful for discovering pods with specific metadata such as @Controller, @Service, or custom annotations.

## Usage Example:

    // Find all controllers
    final controllerNames = await factory.getPodNamesForAnnotation(Class<Controller>());

    for (final name in controllerNames) {
      print('Found controller: $name');
    }

@param type The annotation type to look for @return A Future that completes with a list of pod names

## Implementation

    @override
    Future<List<String>> getPodNamesForAnnotation<A>(Class<A> type) async {
      final result = <String>[];

      // Check definition registry
      final names = getDefinitionNames();
      for (final name in names) {
        final definition = getDefinition(name);

        if (definition.hasAnnotation<A>()) {
          result.add(name);
        } else if (definition.type.hasDirectAnnotation<A>()) {
          result.add(name);
        } else if (definition.type.getAllDirectAnnotations().any((a) => a.getClass() == type)) {
          result.add(name);
        }
      }

      // Check parent factory
      final parent = getParentFactory();
      if (parent != null && parent is ListablePodFactory) {
        result.addAll(await parent.getPodNamesForAnnotation<A>(type));
      }

      return result;
    }