public class DefaultUidGenerator extends java.lang.Object implements UidGenerator
| 限定符和类型 | 类和说明 |
|---|---|
static class |
DefaultUidGenerator.DefaultUidGeneratorBuilder |
| 限定符和类型 | 字段和说明 |
|---|---|
protected BitsAllocator |
bitsAllocator
Stable fields after spring bean initializing
|
protected long |
epochSeconds
Customer epoch, unit as second.
|
protected long |
lastSecond |
protected long |
sequence
Volatile fields caused by nextId()
|
protected long |
workerId |
| 构造器和说明 |
|---|
DefaultUidGenerator() |
| 限定符和类型 | 方法和说明 |
|---|---|
static DefaultUidGenerator.DefaultUidGeneratorBuilder |
builder() |
long |
getUID()
Get a unique ID
|
protected long |
nextId()
Get UID
|
java.lang.String |
parseUID(long uid)
Parse the UID into elements which are used to generate the UID.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdefaultUidGeneratorBuilderprotected long epochSeconds
protected BitsAllocator bitsAllocator
protected long workerId
protected long sequence
protected long lastSecond
public long getUID()
throws UidGenerateException
UidGeneratorgetUID 在接口中 UidGeneratorUidGenerateExceptionpublic java.lang.String parseUID(long uid)
UidGeneratorparseUID 在接口中 UidGeneratorprotected long nextId()
UidGenerateException - in the case: Clock moved backwards; Exceeds the max timestamppublic static DefaultUidGenerator.DefaultUidGeneratorBuilder builder()