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()
and getRevisionNumber()
.Constructor and Description |
---|
AnnotationRevisionMetadata(Object entity,
Class<? extends Annotation> revisionNumberAnnotation,
Class<? extends Annotation> revisionTimeStampAnnotation)
Creates a new
AnnotationRevisionMetadata inspecing 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.
|
org.joda.time.DateTime |
getRevisionDate()
Returns the date of the revision.
|
N |
getRevisionNumber()
Returns the revision number of the revision.
|
public AnnotationRevisionMetadata(Object entity, Class<? extends Annotation> revisionNumberAnnotation, Class<? extends Annotation> revisionTimeStampAnnotation)
AnnotationRevisionMetadata
inspecing 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
- revisionTimeStampAnnotation
- public N getRevisionNumber()
RevisionMetadata
getRevisionNumber
in interface RevisionMetadata<N extends Number & Comparable<N>>
public org.joda.time.DateTime getRevisionDate()
RevisionMetadata
getRevisionDate
in interface RevisionMetadata<N extends Number & Comparable<N>>
public <T> T getDelegate()
RevisionMetadata
getDelegate
in interface RevisionMetadata<N extends Number & Comparable<N>>
Copyright © 2011–2019 Pivotal Software, Inc.. All rights reserved.