Annotation Type Required


  • @Documented
    @Retention(RUNTIME)
    @Target(FIELD)
    public @interface Required
    Marks a configuration key as required.

    When applied to a ConfNGKey enum constant, validation will fail if the configuration value is not set and has no default value.

    Example usage:

    {@code
     public enum MyConfig implements ConfNGKey {
    Since:
    1.1.0
    Author:
    Bharat Kumar Malviya, GitHub: github.com/imBharatMalviya
    See Also:
    ConfigValidator
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      String message
      Custom error message to use when validation fails.
    • 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:
        ""