org.bson.types
Class BSONTimestamp
java.lang.Object
org.bson.types.BSONTimestamp
- All Implemented Interfaces:
- Serializable, Comparable<BSONTimestamp>
public class BSONTimestamp
- extends Object
- implements Comparable<BSONTimestamp>, Serializable
this is used for internal increment values.
for storing normal dates in MongoDB, you should use java.util.Date
time is seconds since epoch
inc is an ordinal
- See Also:
- Serialized Form
BSONTimestamp
public BSONTimestamp()
BSONTimestamp
public BSONTimestamp(int time,
int inc)
getTime
public int getTime()
- Returns:
- get time in seconds since epoch
getInc
public int getInc()
toString
public String toString()
- Overrides:
toString in class Object
compareTo
public int compareTo(BSONTimestamp ts)
- Specified by:
compareTo in interface Comparable<BSONTimestamp>
hashCode
public int hashCode()
- Overrides:
hashCode in class Object
equals
public boolean equals(Object obj)
- Overrides:
equals in class Object