|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.foxinmy.weixin4j.util.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 | ||||||||
Instances of this class are immutable.
| Constructor Summary | |
|---|---|
ObjectId()
Create a new object id. |
|
ObjectId(byte[] b)
Constructs an ObjectId given its 12-byte binary representation. |
|
| Method Summary | |
|---|---|
int |
compareTo(ObjectId id)
|
boolean |
equals(Object o)
|
static ObjectId |
get()
Gets a new object id. |
static int |
getCurrentCounter()
Gets the current value of the auto-incrementing counter. |
Date |
getDate()
Gets the timestamp as a Date instance. |
int |
getTimestamp()
Gets the timestamp (number of seconds since the Unix epoch). |
int |
hashCode()
|
static boolean |
isValid(String s)
Checks if a string could be an ObjectId. |
byte[] |
toByteArray()
Convert to a byte array. |
String |
toHexString()
Converts this instance into a 24-byte hexadecimal string representation. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ObjectId(byte[] b)
b - a byte array of length 12public ObjectId()
| Method Detail |
|---|
public static ObjectId get()
public static boolean isValid(String s)
ObjectId.
s - a potential ObjectId as a String.
IllegalArgumentException - if hexString is nullpublic int hashCode()
hashCode in class Objectpublic boolean equals(Object o)
equals in class Objectpublic String toHexString()
public byte[] toByteArray()
public String toString()
toString in class Objectpublic int compareTo(ObjectId id)
compareTo in interface Comparable<ObjectId>public int getTimestamp()
public Date getDate()
Date instance.
public static int getCurrentCounter()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||