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() |
RevisionMetadata<N> |
getMetadata() |
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<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()
public Optional<Instant> getRevisionInstant()
public Instant getRequiredRevisionInstant()
Instant
. May be null.public int compareTo(@Nullable Revision<N,?> that)
compareTo
in interface Comparable<Revision<N extends Number & Comparable<N>,?>>
public RevisionMetadata<N> getMetadata()
public T getEntity()
Copyright © 2011–2023 Pivotal Software, Inc.. All rights reserved.