Class ObjectId

java.lang.Object
de.undercouch.bson4jackson.types.ObjectId

public class ObjectId extends Object
A unique identifier for MongoDB documents. Such identifiers consist of a timestamp, a machine ID and a counter.
  • Constructor Details

    • ObjectId

      public ObjectId(int timestamp, int counter, int randomValue1, short randomValue2)
      Constructs a new identifier
      Parameters:
      timestamp - the timestamp
      counter - the counter
      randomValue1 - a random value
      randomValue2 - 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