Module com.github.f4b6a3.uuid
Class TimeOrderedFactory
- java.lang.Object
-
- com.github.f4b6a3.uuid.factory.UuidFactory
-
- com.github.f4b6a3.uuid.factory.AbstTimeBasedFactory
-
- com.github.f4b6a3.uuid.factory.rfc4122.TimeOrderedFactory
-
- All Implemented Interfaces:
NoArgsFactory
public final class TimeOrderedFactory extends AbstTimeBasedFactory
Concrete factory for creating time-ordered unique identifiers (UUIDv6).UUIDv6 is a new UUID version proposed by Peabody and Davis.
Warning: this can change in the future.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTimeOrderedFactory.BuilderConcrete builder for creating a time-ordered factory.
-
Field Summary
-
Fields inherited from class com.github.f4b6a3.uuid.factory.AbstTimeBasedFactory
clockseqFunction, nodeidFunction, timeFunction
-
Fields inherited from class com.github.f4b6a3.uuid.factory.UuidFactory
version, versionMask
-
-
Constructor Summary
Constructors Constructor Description TimeOrderedFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TimeOrderedFactory.Builderbuilder()Returns a builder of random-ordered factory.protected longformatMostSignificantBits(long timestamp)Returns the most significant bits of the UUID.-
Methods inherited from class com.github.f4b6a3.uuid.factory.AbstTimeBasedFactory
create, formatLeastSignificantBits, selectNodeIdFunction, selectTimeFunction
-
Methods inherited from class com.github.f4b6a3.uuid.factory.UuidFactory
getVersion, toUuid
-
-
-
-
Method Detail
-
formatMostSignificantBits
protected long formatMostSignificantBits(long timestamp)
Returns the most significant bits of the UUID.It implements the algorithm for generating UUIDv6.
- Overrides:
formatMostSignificantBitsin classAbstTimeBasedFactory- Parameters:
timestamp- the number of 100-nanoseconds since 1970-01-01 (Unix epoch)- Returns:
- the MSB
-
builder
public static TimeOrderedFactory.Builder builder()
Returns a builder of random-ordered factory.- Returns:
- a builder
-
-