Annotation Interface Unmodifiable


@Documented @Retention(RUNTIME) @Target({TYPE_USE,TYPE_PARAMETER}) public @interface Unmodifiable
Convenience alias usually meaning @Ungrowable @SeqUngrowable @Unshrinkable @Unreplaceable. Calling a mutating operation (growing, sequenced-growing, shrinking, or replacing) will throw UnsupportedOperationException.

As an exception, @Unmodifiable means @Maybe* if the type does not support a given category of operation; for example, @Unmodifiable Iterator means @MaybeGrowable @MaybeSeqGrowable @Unshrinkable @MaybeReplaceable Iterator.

See the Checker Framework Manual:
Modifiability Checker