Interface Unmodifiable

All Known Implementing Classes:
UnmodifiableBag, UnmodifiableBidiMap, UnmodifiableBuffer, UnmodifiableCollection, UnmodifiableEntrySet, UnmodifiableIterator, UnmodifiableList, UnmodifiableListIterator, UnmodifiableMap, UnmodifiableMapEntry, UnmodifiableMapIterator, UnmodifiableOrderedBidiMap, UnmodifiableOrderedMap, UnmodifiableOrderedMapIterator, UnmodifiableSet, UnmodifiableSortedBag, UnmodifiableSortedBidiMap, UnmodifiableSortedMap, UnmodifiableSortedSet

@Deprecated(since="2021-04-30") public interface Unmodifiable
Deprecated.
Apache Commons Collections version 3.x is being deprecated from AEMaaCS. The upgraded version 4.4 of Commons Collections is already included as replacement. Customers are advised to upgrade to this version of the library. Please note: the package name was changed to org.apache.commons.collections4. Further note that there are AEM APIs currently exposing the old collections classes; these will be updated in upcoming releases.
Marker interface for collections, maps and iterators that are unmodifiable.

This interface enables testing such as:

  if (coll instanceof Unmodifiable) {
    coll = new ArrayList(coll);
  }
  // now we know coll is modifiable
  
Of course all this only works if you use the Unmodifiable classes defined in this library. If you use the JDK unmodifiable class via java util Collections then the interface won't be there.
Since:
Commons Collections 3.0