Annotation Interface NotEmpty
Validates that a field is not null and not empty.
Supports CharSequence (empty when length() == 0),
Collection and Map (empty when
isEmpty()), and arrays (empty when their length is zero).
A null value always fails this constraint. Any other non-null
type whose emptiness cannot be measured is also treated as invalid.
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanWhether validation failure should fail fast (prevent plugin enable).The error message.The suggestion shown after the error message describing how to fix it.
-
Element Details
-
message
String messageThe error message.- Returns:
- the message
- Default:
- "Value cannot be empty"
-
failFast
boolean failFastWhether validation failure should fail fast (prevent plugin enable).- Returns:
- true to fail fast
- Default:
- true
-
suggestion
String suggestionThe suggestion shown after the error message describing how to fix it. Set to an empty string to omit the suggestion entirely.- Returns:
- the suggestion
- Default:
- "Provide at least one value"
-