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 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.
    • debugString

      default String debugString(Class<T1> c1, Class<T2> c2)
      Used in CondZCompare for debug messages
      Parameters:
      c1 - First class of comparator
      c2 - Second class of comparator
      Returns:
      Simplified string of comparator