public final class ObjectId extends Object implements Serializable
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.
| Modifier and Type | Field and Description |
|---|---|
static long |
OFFSET_SECONDS |
int |
timestamp |
long |
union |
| Constructor and Description |
|---|
ObjectId(io.netty.buffer.ByteBuf buffer) |
ObjectId(int timestamp,
long union) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
int |
getTimestamp() |
long |
getUnion() |
int |
hashCode() |
static void |
main(String[] args) |
static ObjectId |
next()
Gets a new object id.
|
String |
toHexString()
96位编码, 长度为24
|
String |
toHexString32()
128位编码, 长度为32, 前8个字符用'0'填充
|
String |
toString() |
void |
writeTo(io.netty.buffer.ByteBuf buffer) |
public static final long OFFSET_SECONDS
public final int timestamp
public final long union
public ObjectId(int timestamp,
long union)
public ObjectId(io.netty.buffer.ByteBuf buffer)
public static ObjectId next()
public static void main(String[] args)
public int getTimestamp()
public long getUnion()
public void writeTo(io.netty.buffer.ByteBuf buffer)
public String toHexString()
public String toHexString32()
Copyright © 2019. All rights reserved.