Comparable<BsonTimestamp>
public final class BsonTimestamp extends BsonValue implements Comparable<BsonTimestamp>
Constructor | 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 | Description |
---|---|---|
int |
compareTo(BsonTimestamp ts) |
|
boolean |
equals(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() |
|
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 int compareTo(BsonTimestamp ts)
compareTo
in interface Comparable<BsonTimestamp>