Package org.bson.types
Class BSONTimestamp
-
- org.bson.types.BSONTimestamp
-
- All Implemented Interfaces:
,
<BSONTimestamp>
public final class BSONTimestamp extends implements <
This is used for internal increment values. For normal dates you should use java.util.Date time is seconds since epoch inc is an ordinal.- See Also:
- Serialized Form
- MongoDB documentation
-
-
Constructor Summary
Constructors Constructor Description BSONTimestamp()
Creates a new instance.BSONTimestamp(int time, int increment)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(BSONTimestamp ts)
boolean
obj)
int
getInc()
Gets the incrementing ordinal for operations within a given second.int
getTime()
Gets the time in seconds since epochint
hashCode()
toString()
-
-
-
Constructor Detail
-
BSONTimestamp
public BSONTimestamp()
Creates a new instance.
-
BSONTimestamp
public BSONTimestamp(int time, int increment)
Creates a new instance.- Parameters:
time
- the time in seconds since epochincrement
- an incrementing ordinal for operations within a given second- MongoDB documentation
-
-
Method Detail
-
getTime
public int getTime()
Gets the time in seconds since epoch- Returns:
- an int representing time in seconds since epoch
-
getInc
public int getInc()
Gets the incrementing ordinal for operations within a given second.- Returns:
- the increment ordinal
-
toString
public toString()
- Overrides:
in class
-
compareTo
public int compareTo(BSONTimestamp ts)
- Specified by:
in interface
<BSONTimestamp>
-
hashCode
public int hashCode()
- Overrides:
in class
-
equals
public boolean equals( obj)
- Overrides:
in class
-
-