# matchesName method

1. @protected

bool matchesName(

1. String podName, [
2. String? candidateName

])

Checks if a pod name matches a candidate name.

This method checks if the pod name directly matches the candidate name or if any of the pod's aliases match the candidate name.

`podName` the pod name to check `candidateName` the candidate name to match against

Returns `true` if the names match, `false` otherwise

## Implementation

    @protected
    bool matchesName(String podName, [String? candidateName]) {
      return candidateName != null && (candidateName.equals(podName) || getAliases(podName).any((a) => a.equals(candidateName)));
    }