Class HeaderList.Unmodifiable

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

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

This is the "collection-mutator-override" variant of the immutability paradigm. Because HeaderList extends ArrayList, a single modify() 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: