Annotation Interface OneOf
Validates that a string field value is one of the specified options.
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanWhether to ignore case when matching.The error message.The suggestion shown after the error message describing how to fix it.
-
Element Details
-
value
String[] valueThe allowed values.- Returns:
- the allowed values
-
-
-
ignoreCase
boolean ignoreCaseWhether to ignore case when matching.- Returns:
- true to ignore case
- Default:
- false
-
message
String messageThe error message.- Returns:
- the message
- Default:
- "Value must be one of: {value}"
-
suggestion
String suggestionThe suggestion shown after the error message describing how to fix it. Supports the same{...}placeholders asmessage()(substituted at validation time). Set to an empty string to omit the suggestion entirely.- Returns:
- the suggestion template
- Default:
- "Use one of: {value}"
-