Package org.springframework.data.history
Class RevisionSort
java.lang.Object
org.springframework.data.domain.Sort
org.springframework.data.history.RevisionSort
- All Implemented Interfaces:
Serializable
,Iterable<Sort.Order>
,Supplier<Stream<Sort.Order>>
,Streamable<Sort.Order>
A dedicated
Sort
implementation that allows the definition of the ordering of revisions independently of the
property name the revision number is held in.- Since:
- 1.13
- Author:
- Oliver Gierke
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.data.domain.Sort
Sort.Direction, Sort.NullHandling, Sort.Order, Sort.TypedSort<T>
-
Field Summary
Fields inherited from class org.springframework.data.domain.Sort
DEFAULT_DIRECTION
-
Method Summary
Modifier and TypeMethodDescriptionstatic RevisionSort
asc()
Creates aRevisionSort
with ascending order for the revision number property, i.e. more recent revisions will come last.static RevisionSort
desc()
Creates aRevisionSort
with descending order for the revision number property, i.e. more recent revisions will come first.static Sort.Direction
getRevisionDirection
(Sort sort) Returns in which direction to sort revisions for the givenSort
instance.Methods inherited from class org.springframework.data.domain.Sort
and, ascending, by, by, by, by, descending, doReverse, equals, getOrderFor, hashCode, isEmpty, isSorted, isUnsorted, iterator, reverse, sort, toString, unsorted
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
asc
Creates aRevisionSort
with ascending order for the revision number property, i.e. more recent revisions will come last.- Returns:
-
desc
Creates aRevisionSort
with descending order for the revision number property, i.e. more recent revisions will come first.- Returns:
-
getRevisionDirection
Returns in which direction to sort revisions for the givenSort
instance. Defaults toSort.Direction.ASC
.- Parameters:
sort
- must not be null.- Returns:
-