|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.bson.types.ObjectId
public class 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
Constructor Summary | |
---|---|
ObjectId()
Create a new object id. |
|
ObjectId(byte[] b)
|
|
ObjectId(Date time)
|
|
ObjectId(Date time,
int inc)
|
|
ObjectId(Date time,
int machine,
int inc)
|
|
ObjectId(int time,
int machine,
int inc)
|
|
ObjectId(String s)
Creates a new instance from a string. |
|
ObjectId(String s,
boolean babble)
|
Method Summary | |
---|---|
static int |
_flip(int x)
|
int |
_inc()
|
int |
_machine()
|
int |
_time()
|
static String |
babbleToMongod(String b)
|
int |
compareTo(ObjectId id)
|
boolean |
equals(Object o)
|
static ObjectId |
get()
Gets a new object id. |
int |
getInc()
|
int |
getMachine()
|
long |
getTime()
|
int |
hashCode()
|
boolean |
isNew()
|
static boolean |
isValid(String s)
Checks if a string could be an ObjectId . |
static ObjectId |
massageToObjectId(Object o)
Turn an object into an ObjectId , if possible. |
void |
notNew()
|
byte[] |
toByteArray()
|
String |
toString()
|
String |
toStringBabble()
|
String |
toStringMongod()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ObjectId(Date time)
public ObjectId(Date time, int inc)
public ObjectId(Date time, int machine, int inc)
public ObjectId(String s)
s
- the string to convert
IllegalArgumentException
- if the string is not a valid idpublic ObjectId(String s, boolean babble)
public ObjectId(byte[] b)
public ObjectId(int time, int machine, int inc)
public ObjectId()
Method Detail |
---|
public static ObjectId get()
public static boolean isValid(String s)
ObjectId
.
public static ObjectId massageToObjectId(Object o)
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 otherwisepublic int hashCode()
hashCode
in class Object
public boolean equals(Object o)
equals
in class Object
public String toStringBabble()
public String toStringMongod()
public byte[] toByteArray()
public static String babbleToMongod(String b)
public String toString()
toString
in class Object
public int compareTo(ObjectId id)
compareTo
in interface Comparable<ObjectId>
public int getMachine()
public long getTime()
public int getInc()
public int _time()
public int _machine()
public int _inc()
public boolean isNew()
public void notNew()
public static int _flip(int x)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |