# isPrimaryCandidate method

1. @protected

bool isPrimaryCandidate(

1. String podName

)

Checks if a pod is marked as a primary candidate.

Primary candidates are preferred when multiple pods satisfy a dependency.

`podName` the name of the pod to check

Returns `true` if the pod is a primary candidate, `false` otherwise

## Implementation

    @protected
    bool isPrimaryCandidate(String podName) {
      final name = transformedPodName(podName);

      if (containsDefinition(name)) {
        return getLocalMergedPodDefinition(name).design.isPrimary;
      }

      final parent = getParentFactory();
      if (parent != null && parent is DefaultListablePodFactory) {
        return parent.isPrimaryCandidate(name);
      }

      return false;
    }