# setDependencyComparator method

void setDependencyComparator(

1. Comparator<Object> comparator

)

Sets the dependency comparator used by this factory.

The comparator is used to determine the order of dependency resolution when multiple candidates are available. This affects autowiring behavior and collection injection ordering.

`comparator` the dependency comparator to set

Example:

    factory.setDependencyComparator((a, b) => a.priority.compareTo(b.priority));

## Implementation

    void setDependencyComparator(Comparator<Object> comparator) {
      _dependencyComparator = comparator;
    }