public class AnnotationRevisionMetadata<N extends Number & Comparable<N>> extends Object implements RevisionMetadata<N>
RevisionMetadata implementation that inspects the given object for fields with the configured annotations
and returns the field's values on calls to #getRevisionDate(), getRevisionInstant() and
getRevisionNumber().RevisionMetadata.RevisionType| Constructor and Description |
|---|
AnnotationRevisionMetadata(Object entity,
Class<? extends Annotation> revisionNumberAnnotation,
Class<? extends Annotation> revisionTimeStampAnnotation)
Creates a new
AnnotationRevisionMetadata inspecting the given entity for the given annotations. |
AnnotationRevisionMetadata(Object entity,
Class<? extends Annotation> revisionNumberAnnotation,
Class<? extends Annotation> revisionTimeStampAnnotation,
RevisionMetadata.RevisionType revisionType)
Creates a new
AnnotationRevisionMetadata inspecting the given entity for the given annotations. |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
getDelegate()
Returns the underlying revision metadata which might provider more detailed implementation specific information.
|
Optional<Instant> |
getRevisionInstant()
Returns the timestamp of the revision.
|
Optional<N> |
getRevisionNumber()
Returns the revision number of the revision.
|
RevisionMetadata.RevisionType |
getRevisionType()
Returns the
RevisionMetadata.RevisionType of this change. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetRequiredRevisionInstant, getRequiredRevisionNumberpublic AnnotationRevisionMetadata(Object entity, Class<? extends Annotation> revisionNumberAnnotation, Class<? extends Annotation> revisionTimeStampAnnotation)
AnnotationRevisionMetadata inspecting the given entity for the given annotations. If no
annotations will be provided these values will not be looked up from the entity and return null. The
revisionType will be set to unknownentity - must not be null.revisionNumberAnnotation - must not be null.revisionTimeStampAnnotation - must not be null.public AnnotationRevisionMetadata(Object entity, Class<? extends Annotation> revisionNumberAnnotation, Class<? extends Annotation> revisionTimeStampAnnotation, RevisionMetadata.RevisionType revisionType)
AnnotationRevisionMetadata inspecting the given entity for the given annotations. If no
annotations will be provided these values will not be looked up from the entity and return null.entity - must not be null.revisionNumberAnnotation - must not be null.revisionTimeStampAnnotation - must not be null.revisionType - must not be null.public Optional<N> getRevisionNumber()
RevisionMetadatagetRevisionNumber in interface RevisionMetadata<N extends Number & Comparable<N>>public Optional<Instant> getRevisionInstant()
RevisionMetadatagetRevisionInstant in interface RevisionMetadata<N extends Number & Comparable<N>>public RevisionMetadata.RevisionType getRevisionType()
RevisionMetadataRevisionMetadata.RevisionType of this change. If the RevisionMetadata.RevisionType cannot be determined, this method
returns RevisionMetadata.RevisionType.UNKNOWN.getRevisionType in interface RevisionMetadata<N extends Number & Comparable<N>>public <T> T getDelegate()
RevisionMetadatagetDelegate in interface RevisionMetadata<N extends Number & Comparable<N>>Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.