Annotation Interface Size
String.length(); a char is one character), a list's or set's size, a map's number of entries and an
array's length (maps and arrays since 6.3.0, #631). If the size is out of bounds, the module refuses to load naming
the field, the counted size and the violated bounds (on a reload, the reload is refused and the running values are
kept) - the config file is never rewritten (D-01).
On a value type it cannot check, the module is refused at load, before the file is read, naming the field and the
annotation (since 6.3.0, #631; maintainer decision of 2026-10-06). So is this annotation on a field of a config class
that is not a @ConfigEntry setting.
It takes effect only on a field that is itself a @ConfigEntry setting of a config class, judged by that field's
declared type. A declared type that can hold a value the annotation checks - Object, Serializable,
Comparable, CharSequence, Number or another supertype of a checked kind - is accepted, and the
value bound at load is checked; only a type that can never hold a checkable value is a declaration error. A bound
value of a kind the annotation cannot read (text under @Range, a number under @Pattern) is a violation
like any other: the module is refused at load, and a reload is refused with the running values kept. On a field of a value type, a nested class or anything a converter produces it is never checked and not
reported (maintainer decision of 2026-10-06): validate such fields in the module's converter.
- See Also:
-
Optional Element Summary
Optional Elements
-
Element Details
-
min
int minMinimum size (inclusive). Default: 0- Default:
0
-
max
int maxMaximum size (inclusive). Default: Integer.MAX_VALUE- Default:
2147483647
-