Class DefaultClockSeqFunction

    • Constructor Detail

      • DefaultClockSeqFunction

        public DefaultClockSeqFunction()
    • 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:
        applyAsLong in interface LongUnaryOperator
        Parameters:
        timestamp - a timestamp
        Returns:
        a clock sequence
      • next

        public int next()