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 class
Deprecated.The Google Guava Core Libraries are deprecated and will not be part of the AEM SDK after April 2023 -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Deprecated.Unsupported operation.final boolean
addAll
(Collection<? extends E> newElements) Deprecated.Unsupported operation.asList()
Deprecated.Returns a list view of the collection.final void
clear()
Deprecated.Unsupported operation.boolean
Deprecated.abstract UnmodifiableIterator
<E> iterator()
Deprecated.Returns an unmodifiable iterator across the elements in this collection.final boolean
Deprecated.Unsupported operation.final boolean
removeAll
(Collection<?> oldElements) Deprecated.Unsupported operation.final boolean
retainAll
(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, toString
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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:
iterator
in interfaceCollection<E>
- Specified by:
iterator
in interfaceIterable<E>
- Specified by:
iterator
in classAbstractCollection<E>
-
toArray
Deprecated.- Specified by:
toArray
in interfaceCollection<E>
- Overrides:
toArray
in classAbstractCollection<E>
-
toArray
public final <T> T[] toArray(T[] other) Deprecated.- Specified by:
toArray
in interfaceCollection<E>
- Overrides:
toArray
in classAbstractCollection<E>
-
contains
Deprecated.- Specified by:
contains
in interfaceCollection<E>
- Overrides:
contains
in classAbstractCollection<E>
-
add
Deprecated.Unsupported operation.Guaranteed to throw an exception and leave the collection unmodified.- Specified by:
add
in interfaceCollection<E>
- Overrides:
add
in classAbstractCollection<E>
- Throws:
UnsupportedOperationException
- always
-
remove
Deprecated.Unsupported operation.Guaranteed to throw an exception and leave the collection unmodified.- Specified by:
remove
in interfaceCollection<E>
- Overrides:
remove
in classAbstractCollection<E>
- Throws:
UnsupportedOperationException
- always
-
addAll
Deprecated.Unsupported operation.Guaranteed to throw an exception and leave the collection unmodified.- Specified by:
addAll
in interfaceCollection<E>
- Overrides:
addAll
in classAbstractCollection<E>
- Throws:
UnsupportedOperationException
- always
-
removeAll
Deprecated.Unsupported operation.Guaranteed to throw an exception and leave the collection unmodified.- Specified by:
removeAll
in interfaceCollection<E>
- Overrides:
removeAll
in classAbstractCollection<E>
- Throws:
UnsupportedOperationException
- always
-
retainAll
Deprecated.Unsupported operation.Guaranteed to throw an exception and leave the collection unmodified.- Specified by:
retainAll
in interfaceCollection<E>
- Overrides:
retainAll
in classAbstractCollection<E>
- Throws:
UnsupportedOperationException
- always
-
clear
Deprecated.Unsupported operation.Guaranteed to throw an exception and leave the collection unmodified.- Specified by:
clear
in interfaceCollection<E>
- Overrides:
clear
in classAbstractCollection<E>
- Throws:
UnsupportedOperationException
- always
-
asList
Deprecated.Returns a list view of the collection.- Since:
- 2.0
-