Annotation Type Unmodifiable


  • @Documented
    @Target({METHOD,TYPE_USE})
    @Retention(RUNTIME)
    public @interface Unmodifiable
    An annotation marking a returned collection or object as unmodifiable. It is recommended for collection produces annotated with this to actually return an Collections.UnmodifiableCollection or any of its more specific interfaces. This is not enforced however, and it is equally valid to just assume that the API consumer is a reasonable entity. This only describes the API contract; it is not enforcing const-correctness.