Class RandomSequence
java.lang.Object
io.github.honhimw.uuid.RandomSequence
- All Implemented Interfaces:
ClockSequence
Clock sequence generator via random value.
- Since:
- 2025-12-09
-
Constructor Summary
ConstructorsConstructorDescriptionRandomSequence(Supplier<Random> random) Construct clock sequence with random provider -
Method Summary
Modifier and TypeMethodDescriptionlonggenerateSequence(long seconds, int nanos) Generate sequence by unix-timestampintClock sequence bit-length in uuid.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ClockSequence
now
-
Constructor Details
-
RandomSequence
-
-
Method Details
-
generateSequence
public long generateSequence(long seconds, int nanos) Description copied from interface:ClockSequenceGenerate sequence by unix-timestamp- Specified by:
generateSequencein interfaceClockSequence- Parameters:
seconds- unix secondnanos- unix nanosecond- Returns:
- clock sequence
-
usableBits
public int usableBits()Description copied from interface:ClockSequenceClock sequence bit-length in uuid.- Specified by:
usableBitsin interfaceClockSequence- Returns:
- bit length
-