Package org.keycloak.models.map.common
Class UuidValidator
java.lang.Object
org.keycloak.models.map.common.UuidValidator
Utility class for validating and converting UUIDs.
- Author:
- Stefan Guilhen
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
Validates that the specifiedid
is aUUID
.static String
Validates that the specifiedid
is aUUID
.
-
Field Details
-
UUID_REGEX_PATTERN
-
-
Method Details
-
isValid
Validates that the specifiedid
is aUUID
.- Parameters:
id
- theid
to be validated.- Returns:
true
if theid
is aUUID
;false
otherwise.
-
validateAndConvert
Validates that the specifiedid
is aUUID
. If it is, theid
itself is returned. Otherwise, it is discarded and a newUUID
is created and returned.- Parameters:
id
- theid
to be validated.- Returns:
- the
id
itself if it is a validUUID
, or a new generatedUUID
.
-