Annotation Type IntRange
-
@Documented @Retention(RUNTIME) @Target({TYPE_PARAMETER,TYPE_USE}) @SubtypeOf(UnknownVal.class) public @interface IntRange
An expression with this type evaluates to an integral value (byte, short, char, int, or long) in the given range. The bounds are inclusive. For example, the following declaration allows the 12 values 0, 1, ..., 11:@IntRange(from=0, to=11) int month;
If only one of the
to
andfrom
fields is set, then the other will default to the max/min value of the type of the variable that is annotated. (In other words, the defaultsLong.MIN_VALUE
andLong.MAX_VALUE
are used only forlong
; appropriate values are used for other types.)- See the Checker Framework Manual:
- Constant Value Checker