java.lang.Object | |
↳ | org.bson.types.ObjectId |
A globally unique identifier for objects.
Consists of 12 bytes, divided as follows:
0 1 2 3 4 5 6 7 8 9 10 11 time machine pid inc
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new instance from a string.
| |||||||||||
Creates an ObjectId
| |||||||||||
Create a new object id.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Gets a new object id.
| |||||||||||
Gets the current value of the auto increment
| |||||||||||
Gets the generated machine ID, identifying the machine / process / class loader
| |||||||||||
Gets the time of this ID, in milliseconds
| |||||||||||
Gets the time of this ID, in seconds
| |||||||||||
Checks if a string could be an
ObjectId . | |||||||||||
Turn an object into an
ObjectId , if possible. | |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
java.lang.Comparable
|
Creates a new instance from a string.
s | the string to convert |
---|
IllegalArgumentException | if the string is not a valid id |
---|
Creates an ObjectId
time | time in seconds |
---|---|
machine | machine ID |
inc | incremental value |
Create a new object id.
Gets the current value of the auto increment
Gets the generated machine ID, identifying the machine / process / class loader
Gets the time of this ID, in milliseconds
Gets the time of this ID, in seconds
Checks if a string could be an ObjectId
.
Turn an object into an ObjectId
, if possible.
Strings will be converted into ObjectId
s, if possible, and ObjectId
s will
be cast and returned. Passing in null
returns null
.
o | the object to convert |
---|
ObjectId
if it can be massaged, null otherwise