Module com.github.f4b6a3.uuid
Class SuffixCombFactory
- 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.SuffixCombFactory
-
public final class SuffixCombFactory extends AbstCombFactory
Concrete factory for creating Suffix COMB GUIDs.A Suffix COMB GUID is a UUID that combines a creation time with random bits.
The creation millisecond is a 6 bytes SUFFIX at the LEAST significant bits.
The created UUID is a UUIDv4 for compatibility with RFC 9562.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSuffixCombFactory.BuilderBuilder of factories.-
Nested classes/interfaces inherited from class com.github.f4b6a3.uuid.factory.AbstRandomBasedFactory
AbstRandomBasedFactory.FastRandom, AbstRandomBasedFactory.IRandom, AbstRandomBasedFactory.SafeRandom
-
Nested classes/interfaces inherited from class com.github.f4b6a3.uuid.factory.UuidFactory
UuidFactory.Parameters
-
-
Field Summary
-
Fields inherited from class com.github.f4b6a3.uuid.factory.AbstCombFactory
instantFunction
-
Fields inherited from class com.github.f4b6a3.uuid.factory.AbstRandomBasedFactory
lock, random, UUID_BYTES
-
Fields inherited from class com.github.f4b6a3.uuid.factory.UuidFactory
version, versionMask
-
-
Constructor Summary
Constructors Constructor Description SuffixCombFactory()Default constructor.SuffixCombFactory(Clock clock)Constructor with a clock.SuffixCombFactory(LongSupplier randomFunction)Constructor with a function which return random numbers.SuffixCombFactory(LongSupplier randomFunction, Clock clock)Constructor with a function which a function which return random numbers and a clock.SuffixCombFactory(Random random)Constructor with a random.SuffixCombFactory(Random random, Clock clock)Constructor with a random and a clock.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SuffixCombFactory.Builderbuilder()Returns a new builder.UUIDcreate()Returns a Suffix COMB GUID.-
Methods inherited from class com.github.f4b6a3.uuid.factory.AbstRandomBasedFactory
create
-
Methods inherited from class com.github.f4b6a3.uuid.factory.UuidFactory
getVersion, nameBytes, nameBytes, namespaceBytes, namespaceBytes, namespaceBytes, toUuid
-
-
-
-
Constructor Detail
-
SuffixCombFactory
public SuffixCombFactory()
Default constructor.
-
SuffixCombFactory
public SuffixCombFactory(Clock clock)
Constructor with a clock.- Parameters:
clock- a clock
-
SuffixCombFactory
public SuffixCombFactory(Random random)
Constructor with a random.- Parameters:
random- a random generator
-
SuffixCombFactory
public SuffixCombFactory(Random random, Clock clock)
Constructor with a random and a clock.- Parameters:
random- a randomclock- a clock
-
SuffixCombFactory
public SuffixCombFactory(LongSupplier randomFunction)
Constructor with a function which return random numbers.- Parameters:
randomFunction- a function
-
SuffixCombFactory
public SuffixCombFactory(LongSupplier randomFunction, Clock clock)
Constructor with a function which a function which return random numbers and a clock.- Parameters:
randomFunction- a functionclock- a clock
-
-
Method Detail
-
builder
public static SuffixCombFactory.Builder builder()
Returns a new builder.- Returns:
- a builder
-
create
public UUID create()
Returns a Suffix COMB GUID.- Specified by:
createin classUuidFactory- Returns:
- a UUIDv4
-
-