Package com.google.common.collect
Class ImmutableCollection<E>
java.lang.Object
java.util.AbstractCollection<E>
com.google.common.collect.ImmutableCollection<E>
- All Implemented Interfaces:
Serializable,Iterable<E>,Collection<E>
- Direct Known Subclasses:
ImmutableList,ImmutableMultiset,ImmutableSet
@GwtCompatible(emulated=true)
@Deprecated(since="2022-12-01")
public abstract class ImmutableCollection<E>
extends AbstractCollection<E>
implements Serializable
Deprecated.
The Google Guava Core Libraries are deprecated and will not be part of the AEM SDK after April 2023
An immutable collection. Does not permit null elements.
In addition to the Collection methods, this class has an asList() method, which returns a list view of the collection's elements.
Note: Although this class is not final, it cannot be subclassed outside of this package as it has no public or protected constructors. Thus, instances of this type are guaranteed to be immutable.
- Since:
- 2.0 (imported from Google Collections Library)
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDeprecated.The Google Guava Core Libraries are deprecated and will not be part of the AEM SDK after April 2023 -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanDeprecated.Unsupported operation.final booleanaddAll(Collection<? extends E> newElements) Deprecated.Unsupported operation.asList()Deprecated.Returns a list view of the collection.final voidclear()Deprecated.Unsupported operation.booleanDeprecated.abstract UnmodifiableIterator<E> iterator()Deprecated.Returns an unmodifiable iterator across the elements in this collection.final booleanDeprecated.Unsupported operation.final booleanremoveAll(Collection<?> oldElements) Deprecated.Unsupported operation.final booleanretainAll(Collection<?> elementsToKeep) Deprecated.Unsupported operation.final Object[]toArray()Deprecated.final <T> T[]toArray(T[] other) Deprecated.Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, size, toStringMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
-
Method Details
-
iterator
Deprecated.Returns an unmodifiable iterator across the elements in this collection.- Specified by:
iteratorin interfaceCollection<E>- Specified by:
iteratorin interfaceIterable<E>- Specified by:
iteratorin classAbstractCollection<E>
-
toArray
Deprecated.- Specified by:
toArrayin interfaceCollection<E>- Overrides:
toArrayin classAbstractCollection<E>
-
toArray
public final <T> T[] toArray(T[] other) Deprecated.- Specified by:
toArrayin interfaceCollection<E>- Overrides:
toArrayin classAbstractCollection<E>
-
contains
Deprecated.- Specified by:
containsin interfaceCollection<E>- Overrides:
containsin classAbstractCollection<E>
-
add
Deprecated.Unsupported operation.Guaranteed to throw an exception and leave the collection unmodified.- Specified by:
addin interfaceCollection<E>- Overrides:
addin classAbstractCollection<E>- Throws:
UnsupportedOperationException- always
-
remove
Deprecated.Unsupported operation.Guaranteed to throw an exception and leave the collection unmodified.- Specified by:
removein interfaceCollection<E>- Overrides:
removein classAbstractCollection<E>- Throws:
UnsupportedOperationException- always
-
addAll
Deprecated.Unsupported operation.Guaranteed to throw an exception and leave the collection unmodified.- Specified by:
addAllin interfaceCollection<E>- Overrides:
addAllin classAbstractCollection<E>- Throws:
UnsupportedOperationException- always
-
removeAll
Deprecated.Unsupported operation.Guaranteed to throw an exception and leave the collection unmodified.- Specified by:
removeAllin interfaceCollection<E>- Overrides:
removeAllin classAbstractCollection<E>- Throws:
UnsupportedOperationException- always
-
retainAll
Deprecated.Unsupported operation.Guaranteed to throw an exception and leave the collection unmodified.- Specified by:
retainAllin interfaceCollection<E>- Overrides:
retainAllin classAbstractCollection<E>- Throws:
UnsupportedOperationException- always
-
clear
Deprecated.Unsupported operation.Guaranteed to throw an exception and leave the collection unmodified.- Specified by:
clearin interfaceCollection<E>- Overrides:
clearin classAbstractCollection<E>- Throws:
UnsupportedOperationException- always
-
asList
Deprecated.Returns a list view of the collection.- Since:
- 2.0
-