Package groovy.util

Class OrderBy<T>

java.lang.Object
groovy.util.OrderBy<T>
All Implemented Interfaces:
Serializable, Comparator<T>

public class OrderBy<T> extends Object implements Comparator<T>, Serializable
A helper class for sorting objects via a closure to return the field or operation on which to sort.
See Also:
  • Constructor Details

    • OrderBy

      public OrderBy()
    • OrderBy

      public OrderBy(boolean equalityCheck)
    • OrderBy

      public OrderBy(Closure closure)
    • OrderBy

      public OrderBy(Closure closure, boolean equalityCheck)
    • OrderBy

      public OrderBy(List<Closure> closures)
    • OrderBy

      public OrderBy(List<Closure> closures, boolean equalityCheck)
  • Method Details

    • add

      public void add(Closure closure)
    • compare

      public int compare(T object1, T object2)
      Specified by:
      compare in interface Comparator<T>
    • isEqualityCheck

      public boolean isEqualityCheck()
    • setEqualityCheck

      public void setEqualityCheck(boolean equalityCheck)