public final class Revision extends java.lang.Object implements 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(java.lang.Object other) |
static Revision |
fromString(java.lang.String rev) |
int |
getClusterId() |
int |
getCounter() |
static long |
getCurrentTimestamp()
Get the timestamp value of the current date and time.
|
int |
getMemory()
The estimated amount of memory used by this object, in bytes.
|
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() |
java.lang.String |
toReadableString() |
java.lang.String |
toString() |
java.lang.StringBuilder |
toStringBuilder(java.lang.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 static Revision fromString(java.lang.String rev)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.StringBuilder toStringBuilder(java.lang.StringBuilder sb)
sb
- a StringBuilder.public java.lang.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 hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int getClusterId()
public int getMemory()
CacheValue
getMemory
in interface CacheValue
Copyright © 2012–2022 The Apache Software Foundation. All rights reserved.