Class UuidUtil.V7

java.lang.Object
com.helixframework.id.uuid.UuidUtil.V7
Enclosing class:
UuidUtil

public static final class UuidUtil.V7 extends Object
A utility class for Version 7 UUID generation and manipulation according to the IETF UUID draft specification. Version 7 UUIDs are time-ordered UUIDs that use Unix Epoch timestamp in milliseconds as the time source.
  • Constructor Details

    • V7

      public V7()
  • Method Details

    • random

      public static UUID random()
      Generates a new Version 7 UUID using current timestamp and random bits.
      Returns:
      new Version 7 UUID
    • monotonic

      public static UUID monotonic()
      Generates a new Version 7 UUID with monotonically increasing random bits within the same millisecond.
      Returns:
      new Version 7 UUID with monotonic random bits
    • extractInstant

      public static Instant extractInstant(UUID u)
      Extracts the timestamp from a Version 7 UUID.
      Parameters:
      u - UUID to extract timestamp from
      Returns:
      Instant representing the timestamp, or null if not a V7 UUID