Class Revision<N extends Number & Comparable<N>, T>
java.lang.Object
org.springframework.data.history.Revision<N,T>
- All Implemented Interfaces:
Comparable<Revision<N,?>>
public final class Revision<N extends Number & Comparable<N>, T>
extends Object
implements Comparable<Revision<N,?>>
Wrapper to contain
RevisionMetadata as well as the revisioned entity.- Author:
- Oliver Gierke, Philipp Huegelmeyer, Christoph Strobl, Jens Schauder
-
Method Summary
Modifier and TypeMethodDescriptionintbooleanReturns the timestamp of the revision, immediately failing on absence.Returns the revision number of the revision, immediately failing on absence.Returns the timestamp of the revision.Returns the revision number of the revision.inthashCode()static <N extends Number & Comparable<N>, T>
Revision<N, T> of(RevisionMetadata<N> metadata, T entity) Creates a newRevisionfor the givenRevisionMetadataand entity.toString()
-
Method Details
-
of
public static <N extends Number & Comparable<N>, T> Revision<N,T> of(RevisionMetadata<N> metadata, T entity) Creates a newRevisionfor the givenRevisionMetadataand entity.- Parameters:
metadata- must not be null.entity- must not be null.- Returns:
-
getRevisionNumber
-
getRequiredRevisionNumber
Returns the revision number of the revision, immediately failing on absence.- Returns:
- the revision number.
-
getRevisionInstant
-
getRequiredRevisionInstant
-
compareTo
- Specified by:
compareToin interfaceComparable<N extends Number & Comparable<N>>
-
toString
-
getMetadata
-
getEntity
-
equals
-
hashCode
-