Package org.confng.validation
Annotation Type NotEmpty
-
@Documented @Retention(RUNTIME) @Target(FIELD) public @interface NotEmpty
Marks a configuration key as requiring a non-empty value.When applied to a ConfNGKey enum constant, validation will fail if the configuration value is empty (blank string) or contains only whitespace.
Note: This is different from
Required- a value can be present but empty. Use both annotations together if you want to require a non-empty value.Example usage:
{@code public enum MyConfig implements ConfNGKey {- Since:
- 1.1.0
- Author:
- Bharat Kumar Malviya, GitHub: github.com/imBharatMalviya
- See Also:
Required,ConfigValidator
-
-
Element Detail
-
message
String message
Custom error message to use when validation fails. If empty, a default message will be generated.- Returns:
- the custom error message
- Default:
- ""
-
-