Annotation Interface Size


@Target(FIELD) @Retention(RUNTIME) public @interface Size
Validates that a Collection or String config value has a size/length within the specified bounds. If the size is out of bounds, the value is reset to the field's default and a warning is logged.

验证集合或字符串配置值的大小/长度在指定范围内。如果大小超出范围,将重置为字段默认值并记录警告。

See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    int
    Maximum size (inclusive).
    int
    Minimum size (inclusive).
  • Element Details

    • min

      int min
      Minimum size (inclusive). Default: 0
      Default:
      0
    • max

      int max
      Maximum size (inclusive). Default: Integer.MAX_VALUE
      Default:
      2147483647