Package com.google.common.collect
Class ForwardingCollection<E>
java.lang.Object
com.google.common.collect.ForwardingObject
com.google.common.collect.ForwardingCollection<E>
- All Implemented Interfaces:
Iterable<E>,Collection<E>
- Direct Known Subclasses:
ForwardingList,ForwardingMultiset,ForwardingQueue,ForwardingSet
@GwtCompatible
@Deprecated(since="2022-12-01")
public abstract class ForwardingCollection<E>
extends ForwardingObject
implements Collection<E>
Deprecated.
The Google Guava Core Libraries are deprecated and will not be part of the AEM SDK after April 2023
A collection which forwards all its method calls to another collection.
Subclasses should override one or more methods to modify the behavior of the
backing collection as desired per the decorator pattern.
Warning: The methods of ForwardingCollection forward
indiscriminately to the methods of the delegate. For example,
overriding add(E) alone will not change the behavior of addAll(java.util.Collection<? extends E>), which can lead to unexpected behavior. In this case, you should
override addAll as well, either providing your own implementation, or
delegating to the provided standardAddAll method.
The standard methods are not guaranteed to be thread-safe, even
when all of the methods that they depend on are thread-safe.
- Since:
- 2.0 (imported from Google Collections Library)
-
Method Summary
Modifier and TypeMethodDescriptionbooleanDeprecated.booleanaddAll(Collection<? extends E> collection) Deprecated.voidclear()Deprecated.booleanDeprecated.booleancontainsAll(Collection<?> collection) Deprecated.booleanisEmpty()Deprecated.iterator()Deprecated.booleanDeprecated.booleanremoveAll(Collection<?> collection) Deprecated.booleanretainAll(Collection<?> collection) Deprecated.intsize()Deprecated.Object[]toArray()Deprecated.<T> T[]toArray(T[] array) Deprecated.Methods inherited from class com.google.common.collect.ForwardingObject
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. -
size
public int size()Deprecated.- Specified by:
sizein interfaceCollection<E>
-
removeAll
Deprecated.- Specified by:
removeAllin interfaceCollection<E>
-
isEmpty
public boolean isEmpty()Deprecated.- Specified by:
isEmptyin interfaceCollection<E>
-
contains
Deprecated.- Specified by:
containsin interfaceCollection<E>
-
add
Deprecated.- Specified by:
addin interfaceCollection<E>
-
remove
Deprecated.- Specified by:
removein interfaceCollection<E>
-
containsAll
Deprecated.- Specified by:
containsAllin interfaceCollection<E>
-
addAll
Deprecated.- Specified by:
addAllin interfaceCollection<E>
-
retainAll
Deprecated.- Specified by:
retainAllin interfaceCollection<E>
-
clear
public void clear()Deprecated.- Specified by:
clearin interfaceCollection<E>
-
toArray
Deprecated.- Specified by:
toArrayin interfaceCollection<E>
-
toArray
public <T> T[] toArray(T[] array) Deprecated.- Specified by:
toArrayin interfaceCollection<E>
-