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.AbstCombFactory
-
- com.github.f4b6a3.uuid.factory.nonstandard.PrefixCombFactory
-
- All Implemented Interfaces:
NoArgsFactory
public final class PrefixCombFactory extends AbstCombFactory
Concrete factory for creating 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.
The created UUID is a UUIDv4 for compatibility with RFC-4122.
- See Also:
- The Cost of GUIDs as Primary Keys
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPrefixCombFactory.Builder-
Nested classes/interfaces inherited from class com.github.f4b6a3.uuid.factory.AbstRandomBasedFactory
AbstRandomBasedFactory.ByteRandom, AbstRandomBasedFactory.IRandom, AbstRandomBasedFactory.LongRandom
-
-
Field Summary
-
Fields inherited from class com.github.f4b6a3.uuid.factory.AbstCombFactory
clock, DEFAULT_CLOCK
-
Fields inherited from class com.github.f4b6a3.uuid.factory.AbstRandomBasedFactory
random, UUID_BYTES
-
Fields inherited from class com.github.f4b6a3.uuid.factory.UuidFactory
version, versionMask
-
-
Constructor Summary
Constructors Constructor Description PrefixCombFactory()PrefixCombFactory(Clock clock)PrefixCombFactory(IntFunction<byte[]> randomFunction)PrefixCombFactory(IntFunction<byte[]> randomFunction, Clock clock)PrefixCombFactory(LongSupplier randomFunction)PrefixCombFactory(LongSupplier randomFunction, Clock clock)PrefixCombFactory(Random random)PrefixCombFactory(Random random, Clock clock)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PrefixCombFactory.Builderbuilder()UUIDcreate()Returns a Prefix COMB GUID.-
Methods inherited from class com.github.f4b6a3.uuid.factory.UuidFactory
getVersion, toUuid
-
-
-
-
Constructor Detail
-
PrefixCombFactory
public PrefixCombFactory()
-
PrefixCombFactory
public PrefixCombFactory(Clock clock)
-
PrefixCombFactory
public PrefixCombFactory(Random random)
-
PrefixCombFactory
public PrefixCombFactory(LongSupplier randomFunction)
-
PrefixCombFactory
public PrefixCombFactory(IntFunction<byte[]> randomFunction)
-
PrefixCombFactory
public PrefixCombFactory(LongSupplier randomFunction, Clock clock)
-
PrefixCombFactory
public PrefixCombFactory(IntFunction<byte[]> randomFunction, Clock clock)
-
-
Method Detail
-
builder
public static PrefixCombFactory.Builder builder()
-
create
public UUID create()
Returns a Prefix COMB GUID.- Returns:
- a UUIDv4
-
-