Interface Comparator<T1,T2>

Type Parameters:
T1 - The first type for comparison.
T2 - The second type for comparison.
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface Comparator<T1,T2>
Used to compare two objects of a different or the same type.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    compare(T1 o1, T2 o2)
    The main method for this Comparator to determine the Relation between two objects.
    default boolean
     
    default boolean
     
  • Method Details

    • compare

      Relation compare(T1 o1, T2 o2)
      The main method for this Comparator to determine the Relation between two objects.
      Parameters:
      o1 - The first object for comparison.
      o2 - The second object for comparison.
      Returns:
      The Relation between the two provided objects.
    • supportsOrdering

      default boolean supportsOrdering()
      Returns:
      Whether this comparator supports ordering of elements or not.
    • supportsInversion

      default boolean supportsInversion()
      Returns:
      Whether this comparator supports argument inversion through InverseComparator.