Class HttpPartList.Unmodifiable

All Implemented Interfaces:
Serializable, Cloneable, Iterable<HttpPart>, Collection<HttpPart>, List<HttpPart>, RandomAccess, UnmodifiableBean
Enclosing class:
HttpPartList

public static class HttpPartList.Unmodifiable extends HttpPartList implements UnmodifiableBean
An unmodifiable snapshot of a HttpPartList.

This is the "collection-mutator-override" variant of the immutability paradigm. Because HttpPartList extends ArrayList, a single funnel cannot intercept the inherited ArrayList mutators, so this subclass snapshot-copies the elements in its constructor and overrides the entire collection-mutator surface — its own fluent mutators plus the inherited ArrayList mutators (including the iterator() / listIterator() mutators) — to throw UnsupportedOperationException. Read operations and non-mutating iteration continue to work.

See Also: