Package de.undercouch.bson4jackson.types
Class ObjectId
java.lang.Object
de.undercouch.bson4jackson.types.ObjectId
A unique identifier for MongoDB documents. Such identifiers
consist of a timestamp, a machine ID and a counter.
-
Constructor Summary
ConstructorsConstructorDescriptionObjectId(int timestamp, int counter, int randomValue1, short randomValue2) Constructs a new identifier -
Method Summary
Modifier and TypeMethodDescriptionintintshortint
-
Constructor Details
-
ObjectId
public ObjectId(int timestamp, int counter, int randomValue1, short randomValue2) Constructs a new identifier- Parameters:
timestamp- the timestampcounter- the counterrandomValue1- a random valuerandomValue2- a random value
-
-
Method Details
-
getTimestamp
public int getTimestamp()- Returns:
- the timestamp
-
getCounter
public int getCounter()- Returns:
- the counter
-
getRandomValue1
public int getRandomValue1()- Returns:
- a random value
-
getRandomValue2
public short getRandomValue2()- Returns:
- a random value
-