public final class UuidValidator extends Object
Using it is much faster than using on regular expression.
Examples of valid string formats:
12345678-abcd-abcd-abcd-123456789abcd (36 hexadecimal chars,
lower case and with hyphen)
12345678-ABCD-ABCD-ABCD-123456789ABCD (36 hexadecimal chars,
UPPER CASE and with hyphen)
12345678abcdabcdabcd123456789abcd (32 hexadecimal chars,
lower case and WITHOUT hyphen)
12345678ABCDABCDABCD123456789ABCD (32 hexadecimal chars,
UPPER CASE and WITHOUT hyphen)
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
isValid(byte[] uuid)
Checks if the UUID byte array is valid.
|
static boolean |
isValid(byte[] uuid,
int version)
Checks if the UUID byte array is valid.
|
static boolean |
isValid(char[] uuid)
Checks if the UUID char array is valid.
|
static boolean |
isValid(char[] uuid,
int version)
Checks if the UUID char array is valid.
|
static boolean |
isValid(String uuid)
Checks if the UUID string is valid.
|
static boolean |
isValid(String uuid,
int version)
Checks if the UUID string is valid.
|
static boolean |
isValid(UUID uuid)
Checks if the UUID is valid.
|
static boolean |
isValid(UUID uuid,
int version)
Checks if the UUID is valid.
|
static void |
validate(byte[] uuid)
Checks if the UUID byte array is valid.
|
static void |
validate(byte[] uuid,
int version)
Checks if the UUID byte array is valid.
|
static void |
validate(char[] uuid)
Checks if the UUID char array is valid.
|
static void |
validate(char[] uuid,
int version)
Checks if the UUID char array is valid.
|
static void |
validate(String uuid)
Checks if the UUID string is a valid.
|
static void |
validate(String uuid,
int version)
Checks if the UUID string is a valid.
|
static void |
validate(UUID uuid)
Checks if the UUID is valid.
|
static void |
validate(UUID uuid,
int version)
Checks if the UUID is valid.
|
public static boolean isValid(UUID uuid)
uuid - a UUIDpublic static boolean isValid(UUID uuid, int version)
uuid - a UUIDversion - a version numberpublic static boolean isValid(byte[] uuid)
uuid - a UUID byte arraypublic static boolean isValid(byte[] uuid,
int version)
uuid - a UUID byte arrayversion - a version numberpublic static boolean isValid(String uuid)
uuid - a UUID stringpublic static boolean isValid(String uuid, int version)
uuid - a UUID stringversion - a version numberpublic static boolean isValid(char[] uuid)
uuid - a UUID char arraypublic static boolean isValid(char[] uuid,
int version)
uuid - a UUID char arrayversion - a version numberpublic static void validate(UUID uuid)
uuid - a UUIDInvalidUuidException - if the argument is invalidpublic static void validate(UUID uuid, int version)
uuid - a UUIDversion - a version numberInvalidUuidException - if the argument is invalidpublic static void validate(byte[] uuid)
uuid - a UUID byte arrayInvalidUuidException - if the argument is invalidpublic static void validate(byte[] uuid,
int version)
uuid - a UUID byte arrayversion - a version numberInvalidUuidException - if the argument is invalidpublic static void validate(String uuid)
uuid - a UUID stringInvalidUuidException - if the argument is invalidpublic static void validate(String uuid, int version)
uuid - a UUID stringversion - a version numberInvalidUuidException - if the argument is invalidpublic static void validate(char[] uuid)
uuid - a UUID char arrayInvalidUuidException - if the argument is invalidpublic static void validate(char[] uuid,
int version)
uuid - a UUID char arrayversion - a version numberInvalidUuidException - if the argument is invalidCopyright © 2024. All rights reserved.