Class MinimalCollection<E extends @Nullable Object>
java.lang.Object
java.util.AbstractCollection<E>
com.google.common.collect.testing.MinimalCollection<E>
- All Implemented Interfaces:
Iterable<E>,Collection<E>
- Direct Known Subclasses:
MinimalSet
@GwtCompatible
@NullMarked
public class MinimalCollection<E extends @Nullable Object>
extends AbstractCollection<E>
A simplistic collection which implements only the bare minimum allowed by the spec, and throws
exceptions whenever it can.
- Author:
- Kevin Bourrillion
-
Method Summary
Modifier and TypeMethodDescriptionbooleanaddAll(Collection<? extends E> elementsToAdd) voidclear()booleanbooleancontainsAll(Collection<?> collection) iterator()static <E extends @Nullable Object>
MinimalCollection<E> of(E... contents) static <E extends @Nullable Object>
MinimalCollection<E> ofClassAndContents(Class<? super @NonNull E> type, E... contents) booleanremoveAll(Collection<?> elementsToRemove) booleanretainAll(Collection<?> elementsToRetain) intsize()@Nullable Object[]toArray()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
-
Method Details
-
of
-
ofClassAndContents
public static <E extends @Nullable Object> MinimalCollection<E> ofClassAndContents(Class<? super @NonNull E> type, E... contents) -
size
- Specified by:
sizein interfaceCollection<E extends @Nullable Object>- Specified by:
sizein classAbstractCollection<E extends @Nullable Object>
-
contains
- Specified by:
containsin interfaceCollection<E extends @Nullable Object>- Overrides:
containsin classAbstractCollection<E extends @Nullable Object>
-
containsAll
- Specified by:
containsAllin interfaceCollection<E extends @Nullable Object>- Overrides:
containsAllin classAbstractCollection<E extends @Nullable Object>
-
iterator
-
toArray
- Specified by:
toArrayin interfaceCollection<E extends @Nullable Object>- Overrides:
toArrayin classAbstractCollection<E extends @Nullable Object>
-
addAll
- Specified by:
addAllin interfaceCollection<E extends @Nullable Object>- Overrides:
addAllin classAbstractCollection<E extends @Nullable Object>
-
removeAll
- Specified by:
removeAllin interfaceCollection<E extends @Nullable Object>- Overrides:
removeAllin classAbstractCollection<E extends @Nullable Object>
-
retainAll
- Specified by:
retainAllin interfaceCollection<E extends @Nullable Object>- Overrides:
retainAllin classAbstractCollection<E extends @Nullable Object>
-
clear
- Specified by:
clearin interfaceCollection<E extends @Nullable Object>- Overrides:
clearin classAbstractCollection<E extends @Nullable Object>
-