Annotation Type Range


  • @Documented
    @Retention(RUNTIME)
    @Target(FIELD)
    public @interface Range
    Validates that a numeric configuration value is within a specified range.

    When applied to a ConfNGKey enum constant, validation will fail if the configuration value is not a valid number or is outside the specified range.

    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
      long max
      The maximum allowed value (inclusive).
      String message
      Custom error message to use when validation fails.
      long min
      The minimum allowed value (inclusive).
    • Element Detail

      • min

        long min
        The minimum allowed value (inclusive). Defaults to Long.MIN_VALUE (no minimum).
        Returns:
        the minimum value
        Default:
        -9223372036854775808L
      • max

        long max
        The maximum allowed value (inclusive). Defaults to Long.MAX_VALUE (no maximum).
        Returns:
        the maximum value
        Default:
        9223372036854775807L
      • 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:
        ""