Package org.jetbrains.annotations
Annotation Interface Range
An annotation which allows to specify for integral type (byte, char, short, int, long) an allowed values range.
Applying this annotation to other types is not correct.
Example:
public @Range(from = 0, to = Integer.MAX_VALUE) int length() {
return this.length; // returns a non-negative integer
}
- Since:
- 17.0.0
-
Required Element Summary
Required Elements
-
Element Details
-
from
long from- Returns:
- minimal allowed value (inclusive)
-
to
long to- Returns:
- maximal allowed value (inclusive)
-