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
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanValidates that the specifiedidis aUUID.static StringValidates that the specifiedidis aUUID.
-
Field Details
-
UUID_REGEX_PATTERN
-
-
Method Details
-
isValid
Validates that the specifiedidis aUUID.- Parameters:
id- theidto be validated.- Returns:
trueif theidis aUUID;falseotherwise.
-
validateAndConvert
Validates that the specifiedidis aUUID. If it is, theiditself is returned. Otherwise, it is discarded and a newUUIDis created and returned.- Parameters:
id- theidto be validated.- Returns:
- the
iditself if it is a validUUID, or a new generatedUUID.
-