Module com.github.f4b6a3.uuid
Class PrefixCombFactory
- java.lang.Object
-
- com.github.f4b6a3.uuid.factory.UuidFactory
-
- com.github.f4b6a3.uuid.factory.AbstRandomBasedFactory
-
- com.github.f4b6a3.uuid.factory.nonstandard.PrefixCombFactory
-
- All Implemented Interfaces:
NoArgsFactory
public final class PrefixCombFactory extends AbstRandomBasedFactory
Factory that creates Prefix COMB GUIDs. A Prefix COMB GUID is a UUID that combines a creation time with random bits. The creation millisecond is a 6 bytes PREFIX at the MOST significant bits. Read: The Cost of GUIDs as Primary Keys http://www.informit.com/articles/article.aspx?p=25862
-
-
Field Summary
-
Fields inherited from class com.github.f4b6a3.uuid.factory.AbstRandomBasedFactory
randomFunction, UUID_BYTES
-
Fields inherited from class com.github.f4b6a3.uuid.factory.UuidFactory
version, versionMask
-
-
Constructor Summary
Constructors Constructor Description PrefixCombFactory()PrefixCombFactory(RandomFunction randomFunction)PrefixCombFactory(RandomFunction randomFunction, Clock clock)PrefixCombFactory(Clock clock)PrefixCombFactory(Random random)PrefixCombFactory(Random random, Clock clock)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UUIDcreate()Returns a Prefix COMB GUID.-
Methods inherited from class com.github.f4b6a3.uuid.factory.AbstRandomBasedFactory
getRandomFunction
-
Methods inherited from class com.github.f4b6a3.uuid.factory.UuidFactory
getUuid, getUuid, getVersion
-
-
-
-
Constructor Detail
-
PrefixCombFactory
public PrefixCombFactory()
-
PrefixCombFactory
public PrefixCombFactory(Clock clock)
-
PrefixCombFactory
public PrefixCombFactory(Random random)
-
PrefixCombFactory
public PrefixCombFactory(RandomFunction randomFunction)
-
PrefixCombFactory
public PrefixCombFactory(RandomFunction randomFunction, Clock clock)
-
-
Method Detail
-
create
public UUID create()
Returns a Prefix COMB GUID. It combines creation time with random bits. The creation millisecond is a PREFIX at the MOST significant bits.- Specified by:
createin interfaceNoArgsFactory- Overrides:
createin classAbstRandomBasedFactory- Returns:
- a random-based UUID
-
-