Package io.dropwizard.validation
Annotation Type OneOf
-
@Target({METHOD,FIELD,ANNOTATION_TYPE,CONSTRUCTOR,PARAMETER,TYPE_USE}) @Retention(RUNTIME) @Documented @Constraint(validatedBy=OneOfValidator.class) public @interface OneOf
Checks to see that the value is one of a set of elements.
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description Class<?>[]groupsThe groups the constraint belongs to.booleanignoreCaseWhether to ignore case.booleanignoreWhitespaceWhether to ignore leading and trailing whitespace.StringmessageThe validation message for this constraint.Class<? extends jakarta.validation.Payload>[]payloadThe payloads of this constraint.
-
-
-
Element Detail
-
value
String[] value
The set of valid values.- Returns:
- an array containing the valid string values
-
-
-
message
String message
The validation message for this constraint.- Returns:
- the message
- Default:
- "must be one of {value}"
-
-
-
groups
Class<?>[] groups
The groups the constraint belongs to.- Returns:
- an array of classes representing the groups
- Default:
- {}
-
-
-
payload
Class<? extends jakarta.validation.Payload>[] payload
The payloads of this constraint.- Returns:
- the array of payload classes
- Default:
- {}
-
-