Annotation Type UUID
-
@Documented @Constraint(validatedBy={}) @Target({METHOD,FIELD,ANNOTATION_TYPE,CONSTRUCTOR,PARAMETER,TYPE_USE}) @Retention(RUNTIME) @Repeatable(List.class) public @interface UUID
Checks that the annotated character sequence is a valid UUID.Validation characteristics:
- Consists only of numbers, hex characters and dashes
- Has exact length of 36 characters
- Number of hex digits in every group (8-4-4-4-12)
- Nil UUID (default: allowed)
- Allowed UUID versions (default: 1 to 5)
- Allowed UUID variants (default: 0 to 2)
- Letter case (default: lower case)
The supported type is
CharSequence.nullis considered valid.- Since:
- 8.0.0
- Author:
- Daniel Heid
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description booleanallowEmptybooleanallowNilClass<?>[]groupsUUID.LetterCaseletterCaseStringmessageClass<? extends Payload>[]payloadint[]variantMust not be lower than variant 0int[]versionMust not be lower than version 1
-
-
-
Element Detail
-
message
String message
- Default:
- "{org.hibernate.validator.constraints.UUID.message}"
-
-
-
groups
Class<?>[] groups
- Default:
- {}
-
-
-
letterCase
UUID.LetterCase letterCase
- Returns:
- the required letter case Per default only lower case is valid
- See Also:
UUID.LetterCase
- Default:
- org.hibernate.validator.constraints.UUID.LetterCase.LOWER_CASE
-
-