@Retention(value=CLASS) @Target(value={METHOD,FIELD,PARAMETER,LOCAL_VARIABLE,TYPE_USE}) public @interface Range
from <= val < to).
Note that this annotation cannot be used to represent an inclusive upper bound of Long.MAX_VALUE.
This annotation can be applied to methods, fields, parameters, local variables, and types to enforce or document the range constraints for the values they hold.
| Modifier and Type | Optional Element and Description |
|---|---|
long |
from
Specifies the lower bound of the range.
|
long |
to
Specifies the upper bound of the range.
|
String |
value
Specifies an optional comment to provide additional context or rationale for why the
annotated element must be within the specified range.
|
public abstract String value
Copyright © 2024. All rights reserved.