Package: groovy.util

## [Java] Class ClosureComparator<T>

- groovy.util.ClosureComparator

- All Implemented Interfaces and Traits:
    Comparator, Serializable

      public class ClosureComparator<T>
      extends Object
      implements Comparator, Serializable

  A Comparator which uses a closure to compare 2 values being equal

- - ### Constructor Summary

    Constructors
    Constructor and description
    `ClosureComparator(Closure closure)` Creates a comparator backed by the supplied closure.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public int` | `compare(T object1, T object2)` {@inheritDoc}

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### public ClosureComparator(Closure closure)

      Creates a comparator backed by the supplied closure.

      Parameters:
        `closure` - the comparison closure

  - ### Method Detail

    - #### public int compare(T object1, T object2)

      {@inheritDoc}