@Target(value={TYPE_USE,TYPE_PARAMETER,METHOD})
public @interface LengthOf
This is treated as an IndexOrHigh
annotation internally. This is an implementation
detail that may change in the future, when this type may be used to implement more precise
refinements.
The usual use case for the LengthOf
annotation is in the defintions of custom
collections. Consider the signature of java.lang.String#length():
public @LengthOf("this") int length()
Modifier and Type | Required Element and Description |
---|---|
java.lang.String[] |
value
Sequences that the annotated expression is equal to the length of.
|