Module com.github.f4b6a3.uuid
Class DefaultClockSeqFunction
- java.lang.Object
-
- com.github.f4b6a3.uuid.factory.function.impl.DefaultClockSeqFunction
-
- All Implemented Interfaces:
ClockSeqFunction,LongUnaryOperator
public final class DefaultClockSeqFunction extends Object implements ClockSeqFunction
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.github.f4b6a3.uuid.factory.function.ClockSeqFunction
ClockSeqFunction.ClockSeqPool
-
-
Field Summary
Fields Modifier and Type Field Description protected static ClockSeqFunction.ClockSeqPoolPOOL
-
Constructor Summary
Constructors Constructor Description DefaultClockSeqFunction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longapplyAsLong(long timestamp)Returns the next value for a clock sequence. ### RFC-4122 - 4.1.5.intnext()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.function.LongUnaryOperator
andThen, compose
-
-
-
-
Field Detail
-
POOL
protected static final ClockSeqFunction.ClockSeqPool POOL
-
-
Method Detail
-
applyAsLong
public long applyAsLong(long timestamp)
Returns the next value for a clock sequence. ### RFC-4122 - 4.1.5. Clock Sequence (P2) If the clock is set backwards, or might have been set backwards (e.g., while the system was powered off), and the UUID generator can not be sure that no UUIDs were generated with timestamps larger than the value to which the clock was set, then the clock sequence has to be changed. If the previous value of the clock sequence is known, it can just be incremented; otherwise it should be set to a random or high-quality pseudo-random value.- Specified by:
applyAsLongin interfaceLongUnaryOperator- Parameters:
timestamp- a timestamp- Returns:
- a clock sequence
-
next
public int next()
-
-