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.
Used to compare two objects of a different or the same type.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionThe main method for this Comparator to determine the Relation between two objects.default boolean
default boolean
-
Method Details
-
compare
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
.
-