Class PartList.Unmodifiable

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

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

This is the "collection-mutator-override" variant of the immutability paradigm. Because PartList 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: