public final class UuidUtil extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static UUID |
copy(UUID uuid)
Get a copy of a UUID.
|
static int |
getClockSequence(UUID uuid)
Get the clock sequence from a time-based, time-ordered or DCE Security UUID.
|
static java.time.Instant |
getInstant(UUID uuid)
Returns the instant from a time-based, time-ordered or DCE Security UUID.
|
static byte |
getLocalDomain(UUID uuid)
Get the local domain number from a DCE Security UUID.
|
static int |
getLocalIdentifier(UUID uuid)
Get the local identifier number from a DCE Security UUID.
|
static long |
getNodeIdentifier(UUID uuid)
Get the node identifier from a time-based, time-ordered or DCE Security UUID.
|
static long |
getTimestamp(UUID uuid)
Returns the time stamp from a time-based, time-ordered or DCE Security UUID.
|
static UuidVariant |
getVariant(UUID uuid)
Get the UUID version.
|
static UuidVersion |
getVersion(UUID uuid)
Get the UUID version.
|
static boolean |
isCustom(UUID uuid)
Checks whether the UUID version 8.
|
static boolean |
isDceSecurity(UUID uuid)
Checks whether the UUID version 2.
|
static boolean |
isMax(UUID uuid)
Checks whether the UUID is equal to the Max UUID.
|
static boolean |
isNameBasedMd5(UUID uuid)
Checks whether the UUID version 3.
|
static boolean |
isNameBasedSha1(UUID uuid)
Checks whether the UUID version 5.
|
static boolean |
isNil(UUID uuid)
Checks whether the UUID is equal to the Nil UUID.
|
static boolean |
isRandomBased(UUID uuid)
Checks whether the UUID version 4.
|
static boolean |
isReservedFuture(UUID uuid)
Checks whether the UUID variant is reserved future.
|
static boolean |
isReservedMicrosoft(UUID uuid)
Checks whether the UUID variant is reserved Microsoft.
|
static boolean |
isReservedNcs(UUID uuid)
Checks whether the UUID variant is reserved NCS.
|
static boolean |
isRfc4122(UUID uuid)
Checks whether the UUID variant is the one defined by the RFC-4122.
|
static boolean |
isTimeBased(UUID uuid)
Checks whether the UUID version 1.
|
static boolean |
isTimeOrdered(UUID uuid)
Checks whether the UUID version 6.
|
static boolean |
isTimeOrderedEpoch(UUID uuid)
Checks whether the UUID version 7.
|
static UUID |
setVersion(UUID uuid,
int version)
Applies UUID version bits into the UUID
|
public static UUID copy(UUID uuid)
It is just a convenience method for cloning UUIDs.
uuid - a UUIDpublic static boolean isNil(UUID uuid)
The Nil UUID is special UUID that has all 128 bits set to zero.
uuid - a UUIDNullPointerException - if nullpublic static boolean isMax(UUID uuid)
The Max UUID is special UUID that has all 128 bits set to one.
uuid - a UUIDNullPointerException - if nullpublic static UuidVersion getVersion(UUID uuid)
uuid - a UUIDUuidVersionUuidVersionpublic static UuidVariant getVariant(UUID uuid)
uuid - a UUIDUuidVariantUuidVariantpublic static UUID setVersion(UUID uuid, int version)
uuid - a UUIDversion - a versionpublic static boolean isRfc4122(UUID uuid)
uuid - a UUIDpublic static boolean isReservedNcs(UUID uuid)
uuid - a UUIDpublic static boolean isReservedMicrosoft(UUID uuid)
uuid - a UUIDpublic static boolean isReservedFuture(UUID uuid)
uuid - a UUIDpublic static boolean isRandomBased(UUID uuid)
uuid - a UUIDpublic static boolean isNameBasedMd5(UUID uuid)
uuid - a UUIDpublic static boolean isNameBasedSha1(UUID uuid)
uuid - a UUIDpublic static boolean isTimeBased(UUID uuid)
uuid - a UUIDpublic static boolean isTimeOrdered(UUID uuid)
uuid - a UUIDpublic static boolean isTimeOrderedEpoch(UUID uuid)
uuid - a UUIDpublic static boolean isDceSecurity(UUID uuid)
uuid - a UUIDpublic static boolean isCustom(UUID uuid)
uuid - a UUIDpublic static java.time.Instant getInstant(UUID uuid)
uuid - a UUIDInstantIllegalArgumentException - if the input is not a time-based,
time-ordered or DCE Security UUID.public static long getTimestamp(UUID uuid)
The value returned by this method is the number of 100-nanos since 1582-10-15 (Gregorian epoch).
uuid - a UUIDIllegalArgumentException - if the input is not a time-based,
time-ordered or DCE Security UUID.public static long getNodeIdentifier(UUID uuid)
uuid - a UUIDIllegalArgumentException - if the input is not a time-based,
time-ordered or DCE Security UUID.public static int getClockSequence(UUID uuid)
uuid - a UUIDIllegalArgumentException - if the input is not a time-based,
time-ordered or DCE Security UUID.public static byte getLocalDomain(UUID uuid)
uuid - a UUIDIllegalArgumentException - if the input is not a DCE Security UUID.public static int getLocalIdentifier(UUID uuid)
uuid - a UUIDIllegalArgumentException - if the input is not a DCE Security UUID.Copyright © 2024. All rights reserved.