Class By<T>

java.lang.Object
org.dmfs.jems2.comparator.By<T>
All Implemented Interfaces:
Comparator<T>

public final class By<T> extends Object implements Comparator<T>
A Comparator which compares objects by a key derived from the compared objects.
  • Constructor Details

    • By

      public By(Function<? super T,? extends V> keyFunction)
    • By

      public By(Function<? super T,? extends V> keyFunction, Comparator<? super V> delegate)
  • Method Details

    • compare

      public int compare(T left, T right)
      Specified by:
      compare in interface Comparator<T>