public final class Revision<N extends Number & Comparable<N>,T> extends Object implements Comparable<Revision<N,?>>
RevisionMetadata
as well as the revisioned entity.Modifier and Type | Method and Description |
---|---|
int |
compareTo(Revision<N,?> that) |
boolean |
equals(Object o) |
T |
getEntity()
The underlying entity.
|
@NonNull RevisionMetadata<N> |
getMetadata()
The
RevisionMetadata for the current Revision . |
LocalDateTime |
getRequiredRevisionDate()
Deprecated.
Use
getRequiredRevisionInstant() instead. |
Instant |
getRequiredRevisionInstant()
Returns the timestamp of the revision, immediately failing on absence.
|
N |
getRequiredRevisionNumber()
Returns the revision number of the revision, immediately failing on absence.
|
Optional<LocalDateTime> |
getRevisionDate()
Deprecated.
Use
getRevisionInstant() instead. |
Optional<Instant> |
getRevisionInstant()
Returns the timestamp of the revision.
|
Optional<N> |
getRevisionNumber()
Returns the revision number of the revision.
|
int |
hashCode() |
static <N extends Number & Comparable<N>,T> |
of(RevisionMetadata<N> metadata,
T entity)
Creates a new
Revision for the given RevisionMetadata and entity. |
String |
toString() |
public static <N extends Number & Comparable<N>,T> Revision<N,T> of(RevisionMetadata<N> metadata, T entity)
Revision
for the given RevisionMetadata
and entity.metadata
- must not be null.entity
- must not be null.public Optional<N> getRevisionNumber()
public N getRequiredRevisionNumber()
@Deprecated public Optional<LocalDateTime> getRevisionDate()
getRevisionInstant()
instead.public Optional<Instant> getRevisionInstant()
@Deprecated public LocalDateTime getRequiredRevisionDate()
getRequiredRevisionInstant()
instead.public Instant getRequiredRevisionInstant()
Instant
. May be null.public int compareTo(@Nullable Revision<N,?> that)
compareTo
in interface Comparable<Revision<N extends Number & Comparable<N>,?>>
@NonNull public @NonNull RevisionMetadata<N> getMetadata()
RevisionMetadata
for the current Revision
.@NonNull public T getEntity()
Copyright © 2011–2020 Pivotal Software, Inc.. All rights reserved.