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>

    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:
  Serialized Form

### 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

All Methods Static Methods Concrete Methods
`static RevisionSort` `asc()` Creates a `RevisionSort` with ascending order for the revision number property, i.e. more recent revisions will come last.
`static RevisionSort` `desc()` Creates a `RevisionSort` 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 given `Sort` instance.

### Methods inherited from class org.springframework.data.domain.Sort

`and, ascending, by, by, by, by, descending, equals, getOrderFor, hashCode, isSorted, isUnsorted, iterator, sort, toString, unsorted`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.springframework.data.util.Streamable

`and, and, and, and, empty, filter, flatMap, get, isEmpty, map, of, of, of, stream, toList, toSet, toStreamable, toStreamable`

### Methods inherited from interface java.lang.Iterable

`forEach, spliterator`

### Method Detail

#### 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 `Direction#ASC`.

Parameters:
  `sort` - must not be null.
Returns: