SequoiaDB
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Static Public Member Functions | List of all members
org.bson.types.ObjectId Class Reference
Inheritance diagram for org.bson.types.ObjectId:

Public Member Functions

 ObjectId (Date time)
 
 ObjectId (Date time, int inc)
 
 ObjectId (Date time, int machine, int inc)
 
 ObjectId (String s)
 
 ObjectId (String s, boolean babble)
 
 ObjectId (byte[] b)
 
 ObjectId (int time, int machine, int inc)
 
 ObjectId ()
 
int hashCode ()
 
boolean equals (Object o)
 
String toStringBabble ()
 
String toStringMongod ()
 
byte[] toByteArray ()
 
String toString ()
 
int compareTo (ObjectId id)
 
int getMachine ()
 
long getTime ()
 
int getTimeSecond ()
 
int getInc ()
 
int _time ()
 
int _machine ()
 
int _inc ()
 
boolean isNew ()
 
void notNew ()
 

Static Public Member Functions

static ObjectId get ()
 
static boolean isValid (String s)
 
static ObjectId massageToObjectId (Object o)
 
static String babbleToMongod (String b)
 
static int getGenMachineId ()
 
static int getCurrentInc ()
 
static int _flip (int x)
 

Detailed Description

A globally unique identifier for objects.

Consists of 12 bytes, divided as follows:

0123456 7891011
timemachine pidinc

objectids

Constructor & Destructor Documentation

org.bson.types.ObjectId.ObjectId ( String  s)
inline

Creates a new instance from a string.

Parameters
sthe string to convert
Exceptions
IllegalArgumentExceptionif the string is not a valid id
org.bson.types.ObjectId.ObjectId ( int  time,
int  machine,
int  inc 
)
inline

Creates an ObjectId

Parameters
timetime in seconds
machinemachine ID
incincremental value
org.bson.types.ObjectId.ObjectId ( )
inline

Create a new object id.

Member Function Documentation

static ObjectId org.bson.types.ObjectId.get ( )
inlinestatic

Gets a new object id.

Returns
the new id
static int org.bson.types.ObjectId.getCurrentInc ( )
inlinestatic

Gets the current value of the auto increment

static int org.bson.types.ObjectId.getGenMachineId ( )
inlinestatic

Gets the generated machine ID, identifying the machine / process / class loader

long org.bson.types.ObjectId.getTime ( )
inline

Gets the time of this ID, in milliseconds

int org.bson.types.ObjectId.getTimeSecond ( )
inline

Gets the time of this ID, in seconds

static boolean org.bson.types.ObjectId.isValid ( String  s)
inlinestatic

Checks if a string could be an ObjectId.

Returns
whether the string could be an object id
static ObjectId org.bson.types.ObjectId.massageToObjectId ( Object  o)
inlinestatic

Turn an object into an ObjectId, if possible. Strings will be converted into ObjectIds, if possible, and ObjectIds will be cast and returned. Passing in null returns null.

Parameters
othe object to convert
Returns
an ObjectId if it can be massaged, null otherwise

The documentation for this class was generated from the following file: