Package com.helixframework.id.uuid
Class UuidUtil.V4
java.lang.Object
com.helixframework.id.uuid.UuidUtil.V4
- Enclosing class:
- UuidUtil
A utility class for Version 4 UUID generation and manipulation.
Provides methods for generating random and ordered UUIDs with version 4.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
V4
public V4()
-
-
Method Details
-
random
Generates a random Version 4 UUID.- Returns:
- new random Version 4 UUID
-
ordered
Generates a monotonically ordered Version 4 UUID. MSB encodes the current epoch millis (with version 4 set) without modification. LSB carries a 62-bit counter/random value with RFC 4122 variant, ensuring monotonicity within the same millisecond.- Returns:
- new monotonically ordered Version 4 UUID
-
extractInstant
Extracts the timestamp from a Version 4 UUID.- Parameters:
u- UUID to extract timestamp from- Returns:
- Instant representing the timestamp, or null if not a V4 UUID
-