#116 - Implemented RevisionMetadata.getRevisionInstant().
Implemented the missing new method RevisionMetadata.getRevisionInstant() by extracting part of ….getRevisionDate(). This makes DefaultRevisionMetadata compile again. Decided against a default implementation on the interface side since it would just hide the fact that the interface changed. Original pull request: #118.
This commit is contained in:
committed by
Oliver Gierke
parent
67c14d8883
commit
14e4386205
@@ -52,8 +52,19 @@ public class DefaultRevisionMetadata implements RevisionMetadata<Integer> {
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.history.RevisionMetadata#getRevisionDate()
|
||||
*/
|
||||
@Deprecated
|
||||
public Optional<LocalDateTime> getRevisionDate() {
|
||||
return Optional.of(LocalDateTime.ofInstant(Instant.ofEpochMilli(entity.getTimestamp()), ZoneOffset.systemDefault()));
|
||||
return getRevisionInstant().map(instant -> LocalDateTime.ofInstant(instant, ZoneOffset.systemDefault()));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.history.RevisionMetadata#getRevisionInstant()
|
||||
*/
|
||||
@Override
|
||||
public Optional<Instant> getRevisionInstant() {
|
||||
return Optional.of(Instant.ofEpochMilli(entity.getTimestamp()));
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user