Annotation Interface MinValue


@Target(FIELD) @Retention(RUNTIME) @Documented public @interface MinValue
Specifies the minimum value for numeric configuration fields. When a config value is loaded that is less than the minimum, it will be automatically clamped to the minimum value.

Supports: byte, short, int, long, float, double and their wrapper types.

Example:

@ConfigValue("retry_interval")
@MinValue(5)
@Comment("Retry interval in seconds (minimum: 5)")
private int retryInterval = 10;
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    double
    The minimum allowed value for this field.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Whether to log a warning when a value is clamped.
  • Element Details

    • value

      double value
      The minimum allowed value for this field.
      Returns:
      the minimum value
    • warn

      boolean warn
      Whether to log a warning when a value is clamped.
      Returns:
      true to log warnings, false otherwise
      Default:
      true