Package me.ahoo.cosid.jvm
Class UuidGenerator
java.lang.Object
me.ahoo.cosid.jvm.UuidGenerator
- All Implemented Interfaces:
IdGenerator
,Statistical
,StringIdGenerator
UUID ID Generator.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionlong
generate()
Generate distributed ID.Generate string type distributed ID.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface me.ahoo.cosid.IdGenerator
idConverter, stat
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
UuidGenerator
public UuidGenerator()
-
-
Method Details
-
generate
public long generate()Description copied from interface:IdGenerator
Generate distributed ID.- Specified by:
generate
in interfaceIdGenerator
- Returns:
- generated distributed ID
-
generateAsString
Description copied from interface:StringIdGenerator
Generate string type distributed ID.- Specified by:
generateAsString
in interfaceIdGenerator
- Specified by:
generateAsString
in interfaceStringIdGenerator
- Returns:
- string type distributed ID
-