org.springframework.data.history

## Class Revisions<N extends Number & Comparable<N>,T>

- java.lang.Object
- - org.springframework.data.history.Revisions<N,T>

All Implemented Interfaces:
  Iterable<Revision<N,T>>, Supplier<Stream<Revision<N,T>>>, Streamable<Revision<N,T>>

    public class Revisions<N extends Number & Comparable<N>,T>
    extends Object
    implements Streamable<Revision<N,T>>

Simple wrapper class for a `List` of `Revisions` allowing to canonically access the latest revision. Allows iterating over the underlying `Revisions` starting with older revisions.

Author:
  Oliver Gierke, Christoph Strobl

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`List<Revision<N,T>>` `getContent()` Returns the content of the `Revisions` instance.
`Revision<N,T>` `getLatestRevision()` Returns the latest revision of the revisions backing the wrapper independently of the order.
`Iterator<Revision<N,T>>` `iterator()`
`static <N extends Number & Comparable<N>,T> Revisions<N,T>` `none()` Creates a new empty `Revisions` instance.
`static <N extends Number & Comparable<N>,T> Revisions<N,T>` `of(List<? extends Revision<N,T>> revisions)` Creates a new `Revisions` instance for the given `Revision`s.
`Revisions<N,T>` `reverse()` Reverses the current `Revisions`.

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

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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

#### of

    public static <N extends Number & Comparable<N>,T> Revisions<N,T> of(List<? extends Revision<N,T>> revisions)

Creates a new `Revisions` instance for the given `Revision`s.

Returns:
  will never be null.

#### none

    public static <N extends Number & Comparable<N>,T> Revisions<N,T> none()

Creates a new empty `Revisions` instance.

Returns:
  will never be null.

#### getLatestRevision

    public Revision<N,T> getLatestRevision()

Returns the latest revision of the revisions backing the wrapper independently of the order.

Returns:

#### reverse

    public Revisions<N,T> reverse()

Reverses the current `Revisions`. By default this will return the revisions with the latest revision first.

Returns:

#### iterator

    public Iterator<Revision<N,T>> iterator()

Specified by:
  `iterator` in interface `Iterable<Revision<N extends Number & Comparable<N>,T>>`

#### getContent

    public List<Revision<N,T>> getContent()

Returns the content of the `Revisions` instance.

Returns: