Class PropertyPathComparator<T>
java.lang.Object
org.springframework.data.keyvalue.core.PropertyPathComparator<T>
- All Implemented Interfaces:
Comparator<T>
Comparator
implementation to compare objects based on a PropertyPath
. This comparator obtains the
value at PropertyPath
from the given comparison objects
and then performs
the comparison.- Since:
- 3.1.10
- Author:
- Christoph Strobl, Mark Paluch
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasc()
Sort ascending.int
desc()
Sort descending.protected <T> Object
getCompareValue
(T object, PropertyPath propertyPath) Sort null values first.Sort null values last.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
PropertyPathComparator
-
-
Method Details
-
compare
- Specified by:
compare
in interfaceComparator<T>
-
getCompareValue
-
asc
Sort ascending.- Returns:
-
desc
Sort descending.- Returns:
-
nullsFirst
Sort null values first.- Returns:
-
nullsLast
Sort null values last.- Returns:
-