Module com.github.f4b6a3.uuid
Class ShortSuffixCombFactory
- 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.ShortSuffixCombFactory
-
- All Implemented Interfaces:
NoArgsFactory
public final class ShortSuffixCombFactory extends AbstCombFactory
Concrete factory for creating Short Suffix COMB GUIDs.A Short Suffix COMB GUID is a UUID that combines a creation time with random bits.
The creation minute is a 2 bytes SUFFIX at the LEAST significant bits.
The suffix wraps around every ~45 days (2^16/60/24 = ~45).
The created UUID is a UUIDv4 for compatibility with RFC-4122.
- See Also:
- Sequential UUID Generators
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classShortSuffixCombFactory.Builder-
Nested classes/interfaces inherited from class com.github.f4b6a3.uuid.factory.AbstRandomBasedFactory
AbstRandomBasedFactory.ByteRandom, AbstRandomBasedFactory.IRandom, AbstRandomBasedFactory.LongRandom
-
-
Field Summary
Fields Modifier and Type Field Description protected static intDEFAULT_INTERVALprotected intinterval-
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 ShortSuffixCombFactory()ShortSuffixCombFactory(Clock clock)ShortSuffixCombFactory(IntFunction<byte[]> randomFunction)ShortSuffixCombFactory(IntFunction<byte[]> randomFunction, Clock clock)ShortSuffixCombFactory(LongSupplier randomFunction)ShortSuffixCombFactory(LongSupplier randomSupplier, Clock clock)ShortSuffixCombFactory(Random random)ShortSuffixCombFactory(Random random, Clock clock)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ShortSuffixCombFactory.Builderbuilder()UUIDcreate()Returns a Short Suffix COMB GUID.-
Methods inherited from class com.github.f4b6a3.uuid.factory.UuidFactory
getVersion, toUuid
-
-
-
-
Field Detail
-
interval
protected final int interval
-
DEFAULT_INTERVAL
protected static final int DEFAULT_INTERVAL
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ShortSuffixCombFactory
public ShortSuffixCombFactory()
-
ShortSuffixCombFactory
public ShortSuffixCombFactory(Clock clock)
-
ShortSuffixCombFactory
public ShortSuffixCombFactory(Random random)
-
ShortSuffixCombFactory
public ShortSuffixCombFactory(LongSupplier randomFunction)
-
ShortSuffixCombFactory
public ShortSuffixCombFactory(IntFunction<byte[]> randomFunction)
-
ShortSuffixCombFactory
public ShortSuffixCombFactory(LongSupplier randomSupplier, Clock clock)
-
ShortSuffixCombFactory
public ShortSuffixCombFactory(IntFunction<byte[]> randomFunction, Clock clock)
-
-
Method Detail
-
builder
public static ShortSuffixCombFactory.Builder builder()
-
create
public UUID create()
Returns a Short Suffix COMB GUID.- Returns:
- a UUIDv4
-
-