Annotation Interface ConfigValue


@Retention(RUNTIME) @Target(FIELD) public @interface ConfigValue
Annotation to mark a field as a configuration value. This annotation specifies which configuration key should be used to populate the annotated field.
Since:
1.0.0
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The configuration key path.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The default value to use if the configuration key is not found.
    boolean
    Whether the configuration value is required.
  • Element Details

    • key

      String key
      The configuration key path.
      Returns:
      The configuration key path
    • required

      boolean required
      Whether the configuration value is required. If true and the value is not found in the configuration, an exception will be thrown.
      Returns:
      True if the value is required, false otherwise
      Default:
      true
    • defaultValue

      String defaultValue
      The default value to use if the configuration key is not found. This is only used if required is set to false.
      Returns:
      The default value as a string
      Default:
      ""