Package org.keycloak.models.map.common
Class UuidValidator
- java.lang.Object
- 
- org.keycloak.models.map.common.UuidValidator
 
- 
 public class UuidValidator extends Object Utility class for validating and converting UUIDs.- Author:
- Stefan Guilhen
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected static PatternUUID_REGEX_PATTERN
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisValid(String id)Validates that the specifiedidis aUUID.static StringvalidateAndConvert(String id)Validates that the specifiedidis aUUID.
 
- 
- 
- 
Field Detail- 
UUID_REGEX_PATTERNprotected static final Pattern UUID_REGEX_PATTERN 
 
- 
 - 
Method Detail- 
isValidpublic static boolean isValid(String id) Validates that the specifiedidis aUUID.- Parameters:
- id- the- idto be validated.
- Returns:
- trueif the- idis a- UUID;- falseotherwise.
 
 - 
validateAndConvertpublic static String validateAndConvert(String id) Validates that the specifiedidis aUUID. If it is, theiditself is returned. Otherwise, it is discarded and a newUUIDis created and returned.- Parameters:
- id- the- idto be validated.
- Returns:
- the iditself if it is a validUUID, or a new generatedUUID.
 
 
- 
 
-