# Class Namer.Comparator<T>

java.lang.Object
org.gradle.api.Namer.Comparator<T>

Type Parameters:
  `T` - The type of object that the namer can name

All Implemented Interfaces:
  `Comparator<T>`

Enclosing interface:
  `Namer<T>`

public static class Namer.Comparator<T> extends Object implements Comparator<T>
A comparator implementation based on the names returned by the given namer.

Since:
  1.0

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Comparator(Namer<? super T> namer)`
  Creates a new `Comparator`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `compare(T o1, T o2)`
  `boolean`
  `equals(Object obj)`
  `int`
  `hashCode()`

  ### Methods inherited from class Object

  `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface Comparator

  `reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong`

- ## Constructor Details

  - ### Comparator

    public Comparator(Namer<? super T> namer)
    Creates a new `Comparator`.
    Since:
      1.0

- ## Method Details

  - ### compare

    public int compare(T o1, T o2)
    Specified by:
      `compare` in interface `Comparator<T>`

  - ### equals

    public boolean equals(Object obj)
    Specified by:
      `equals` in interface `Comparator<T>`
    Overrides:
      `equals` in class `Object`

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`