public final class Revision extends Object implements org.apache.jackrabbit.oak.cache.CacheValue
| Constructor and Description |
|---|
Revision(long timestamp,
int counter,
int clusterId) |
Revision(long timestamp,
int counter,
int clusterId,
boolean branch) |
| Modifier and Type | Method and Description |
|---|---|
Revision |
asBranchRevision()
Returns a revision with the same timestamp, counter and clusterId as this
revision and the branch flag set to
true. |
Revision |
asTrunkRevision()
Returns a revision with the same timestamp, counter and clusterId as this
revision and the branch flag set to
false. |
boolean |
equals(Object other) |
static Revision |
fromString(String rev) |
int |
getClusterId() |
int |
getCounter() |
static long |
getCurrentTimestamp()
Get the timestamp value of the current date and time.
|
int |
getMemory() |
long |
getTimestamp()
Get the timestamp in milliseconds since 1970.
|
static long |
getTimestampDifference(Revision r1,
Revision r2)
Get the timestamp difference between two revisions (r1 - r2) in
milliseconds.
|
int |
hashCode() |
boolean |
isBranch() |
String |
toReadableString() |
String |
toString() |
StringBuilder |
toStringBuilder(StringBuilder sb)
Appends the string representation of this revision to the given
StringBuilder.
|
public Revision(long timestamp,
int counter,
int clusterId)
public Revision(long timestamp,
int counter,
int clusterId,
boolean branch)
public static long getCurrentTimestamp()
public static long getTimestampDifference(Revision r1, Revision r2)
r1 - the first revisionr2 - the second revisionpublic StringBuilder toStringBuilder(StringBuilder sb)
sb - a StringBuilder.public String toReadableString()
public long getTimestamp()
public int getCounter()
public boolean isBranch()
true if this is a branch revision, otherwise
false.public Revision asBranchRevision()
true.public Revision asTrunkRevision()
false.public int getClusterId()
public int getMemory()
getMemory in interface org.apache.jackrabbit.oak.cache.CacheValueCopyright © 2012–2018 The Apache Software Foundation. All rights reserved.