Annotation Interface PolyModifiable
Convenience alias meaning
@PolyGrowable @PolySeqGrowable @PolyShrinkable @PolyReplaceable. A polymorphic qualifier
for the four capability hierarchies.
This alias does not expand into the Iterator hierarchy. Write @PolyIteratorPolyMod
explicitly to make a method preserve @IteratorPolyMod.
Write @PolyModifiable on methods that preserve or transfer modifiability, such as
List.subList().
For example:
interface Example<E> {
@PolyModifiable List<E> subList(@PolyModifiable Example<E> this, int from, int to);
}
At each call site, the return type is equal to the receiver type. If the receiver type is
@Growable, the return type is @Growable. If the receiver type is
@Ungrowable, the return type is @Ungrowable.- See the Checker Framework Manual:
- Modifiability Checker, Qualifier polymorphism