Module com.github.f4b6a3.uuid
Class ShortPrefixCombFactory
- java.lang.Object
-
- com.github.f4b6a3.uuid.factory.UuidFactory
-
- com.github.f4b6a3.uuid.factory.AbstRandomBasedFactory
-
- com.github.f4b6a3.uuid.factory.nonstandard.ShortPrefixCombFactory
-
- All Implemented Interfaces:
NoArgsFactory
public final class ShortPrefixCombFactory 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 minute is a 2 bytes PREFIX at the MOST significant bits. The prefix wraps around every ~45 days (2^16/60/24 = ~45). Read: Sequential UUID Generators https://www.2ndquadrant.com/en/blog/sequential-uuid-generators/
-
-
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 ShortPrefixCombFactory()ShortPrefixCombFactory(RandomFunction randomFunction)ShortPrefixCombFactory(RandomFunction randomFunction, Clock clock)ShortPrefixCombFactory(Clock clock)ShortPrefixCombFactory(Random random)ShortPrefixCombFactory(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
-
ShortPrefixCombFactory
public ShortPrefixCombFactory()
-
ShortPrefixCombFactory
public ShortPrefixCombFactory(Clock clock)
-
ShortPrefixCombFactory
public ShortPrefixCombFactory(Random random)
-
ShortPrefixCombFactory
public ShortPrefixCombFactory(RandomFunction randomFunction)
-
ShortPrefixCombFactory
public ShortPrefixCombFactory(RandomFunction randomFunction, Clock clock)
-
-
Method Detail
-
create
public UUID create()
Returns a Prefix COMB GUID. It combines creation time with random bits. The creation minute is a 2 bytes PREFIX at the MOST significant bits. The prefix wraps around every ~45 days (2^16/60/24 = ~45).- Specified by:
createin interfaceNoArgsFactory- Overrides:
createin classAbstRandomBasedFactory- Returns:
- a random-based UUID
-
-