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.
|
RevisionMetadata<N> |
getMetadata()
The
RevisionMetadata for the current Revision . |
LocalDateTime |
getRequiredRevisionDate()
Returns the revision date of the revision, immediately failing on absence.
|
N |
getRequiredRevisionNumber()
Returns the revision number of the revision, immediately failing on absence.
|
Optional<LocalDateTime> |
getRevisionDate()
Returns the revision date 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<LocalDateTime> getRevisionDate()
public LocalDateTime getRequiredRevisionDate()
public int compareTo(@Nullable Revision<N,?> that)
compareTo
in interface Comparable<Revision<N extends Number & Comparable<N>,?>>
@NonNull @Generated(value="lombok") public RevisionMetadata<N> getMetadata()
RevisionMetadata
for the current Revision
.@NonNull @Generated(value="lombok") public T getEntity()
@Generated(value="lombok") public boolean equals(Object o)
@Generated(value="lombok") public int hashCode()
Copyright © 2011–2018 Pivotal Software, Inc.. All rights reserved.