public final class BsonTimestamp extends BsonValue implements java.lang.Comparable<BsonTimestamp>
Constructor and Description |
---|
BsonTimestamp()
Construct a new instance with a null time and a 0 increment.
|
BsonTimestamp(int seconds,
int increment)
Construct a new instance for the given time and increment.
|
BsonTimestamp(long value)
Construct a new instance for the given value, which combines the time in seconds and the increment as a single long value.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(BsonTimestamp ts) |
boolean |
equals(java.lang.Object o) |
BsonType |
getBsonType()
Gets the BSON type of this value.
|
int |
getInc()
Gets the increment value.
|
int |
getTime()
Gets the time in seconds since epoch.
|
long |
getValue()
Gets the value of the timestamp.
|
int |
hashCode() |
java.lang.String |
toString() |
asArray, asBinary, asBoolean, asDateTime, asDBPointer, asDecimal128, asDocument, asDouble, asInt32, asInt64, asJavaScript, asJavaScriptWithScope, asNumber, asObjectId, asRegularExpression, asString, asSymbol, asTimestamp, isArray, isBinary, isBoolean, isDateTime, isDBPointer, isDecimal128, isDocument, isDouble, isInt32, isInt64, isJavaScript, isJavaScriptWithScope, isNull, isNumber, isObjectId, isRegularExpression, isString, isSymbol, isTimestamp
public BsonTimestamp()
public BsonTimestamp(long value)
value
- the timetamp as a single long valuepublic BsonTimestamp(int seconds, int increment)
seconds
- the number of seconds since the epochincrement
- the increment.public BsonType getBsonType()
BsonValue
getBsonType
in class BsonValue
public long getValue()
public int getTime()
public int getInc()
public java.lang.String toString()
toString
in class java.lang.Object
public int compareTo(BsonTimestamp ts)
compareTo
in interface java.lang.Comparable<BsonTimestamp>
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object