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>

public class RevisionSort extends Sort
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:
  • Method Details

    • asc

      public static RevisionSort asc()
      Creates a RevisionSort with ascending order for the revision number property, i.e. more recent revisions will come last.
      Returns:
    • desc

      public static RevisionSort desc()
      Creates a RevisionSort with descending order for the revision number property, i.e. more recent revisions will come first.
      Returns:
    • getRevisionDirection

      public static Sort.Direction getRevisionDirection(Sort sort)
      Returns in which direction to sort revisions for the given Sort instance. Defaults to Sort.Direction.ASC.
      Parameters:
      sort - must not be null.
      Returns: