public final class TimeOrderedEpochFactory extends AbstCombFactory
UUIDv7 is a new UUID version proposed by Peabody and Davis. It is similar to Prefix COMB GUID and ULID.
This factory creates 3 types:
Warning: this can change in the future.
PrefixCombFactory,
ULID Specification,
New
UUID formats,
Revise
Universally Unique Identifier Definitions (uuidrev)| Modifier and Type | Class and Description |
|---|---|
static class |
TimeOrderedEpochFactory.Builder
Concrete builder for creating a Unix epoch time-ordered factory.
|
AbstRandomBasedFactory.FastRandom, AbstRandomBasedFactory.IRandom, AbstRandomBasedFactory.SafeRandomUuidFactory.ParameterstimeFunctionlock, random, UUID_BYTESversion, versionMask| Constructor and Description |
|---|
TimeOrderedEpochFactory()
Default constructor.
|
TimeOrderedEpochFactory(Clock clock)
Constructor with a clock.
|
TimeOrderedEpochFactory(LongSupplier randomFunction)
Constructor with a function which return random numbers.
|
TimeOrderedEpochFactory(LongSupplier randomFunction,
Clock clock)
Constructor with a function which a function which return random numbers and
a clock.
|
TimeOrderedEpochFactory(Random random)
Constructor with a random.
|
TimeOrderedEpochFactory(Random random,
Clock clock)
Constructor with a random and a clock.
|
| Modifier and Type | Method and Description |
|---|---|
static TimeOrderedEpochFactory.Builder |
builder()
Returns a builder of Unix epoch time-ordered factory.
|
UUID |
create()
Returns a time-ordered unique identifier (UUIDv7).
|
UUID |
create(UuidFactory.Parameters parameters)
Returns a time-ordered unique identifier (UUIDv7) for a given instant.
|
getVersion, nameBytes, nameBytes, namespaceBytes, namespaceBytes, namespaceBytes, toUuidpublic TimeOrderedEpochFactory()
public TimeOrderedEpochFactory(Clock clock)
clock - a clockpublic TimeOrderedEpochFactory(Random random)
random - a randompublic TimeOrderedEpochFactory(Random random, Clock clock)
random - a randomclock - a clockpublic TimeOrderedEpochFactory(LongSupplier randomFunction)
randomFunction - a functionpublic TimeOrderedEpochFactory(LongSupplier randomFunction, Clock clock)
randomFunction - a functionclock - a clockpublic static TimeOrderedEpochFactory.Builder builder()
public UUID create()
create in class UuidFactorypublic UUID create(UuidFactory.Parameters parameters)
The random component is generated with each method invocation.
create in class AbstRandomBasedFactoryinstant - a given instantCopyright © 2024. All rights reserved.