public final class CollectionAdapter<T> extends AbstractCollectionAdapter<T> implements Serializable
To create a new instance that wraps a collection with the MutableSet interface, use the wrapSet(Iterable)
factory method. To create a new instance that wraps a collection with the MutableList interface, use the
wrapList(Iterable) factory method. To wrap a collection with the MutableCollection interface alone, use
the adapt(Collection) factory method.
| Constructor and Description |
|---|
CollectionAdapter(Collection<T> newDelegate) |
| Modifier and Type | Method and Description |
|---|---|
static <E> MutableCollection<E> |
adapt(Collection<E> collection) |
MutableCollection<T> |
asSynchronized() |
MutableCollection<T> |
asUnmodifiable() |
boolean |
equals(Object o) |
int |
hashCode() |
MutableCollection<T> |
newEmpty()
Deprecated.
use
FastList.newList() or UnifiedSet.newSet() instead |
ImmutableCollection<T> |
toImmutable() |
CollectionAdapter<T> |
with(T... elements) |
CollectionAdapter<T> |
with(T element) |
CollectionAdapter<T> |
withAll(Iterable<? extends T> elements) |
CollectionAdapter<T> |
without(T element) |
CollectionAdapter<T> |
withoutAll(Iterable<? extends T> elements) |
static <E> MutableList<E> |
wrapList(Iterable<E> iterable) |
static <E> MutableSet<E> |
wrapSet(Iterable<E> iterable) |
add, addAll, addAllIterable, allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, asLazy, chunk, clear, collect, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectIf, collectInt, collectLong, collectShort, collectWith, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, count, countWith, detect, detectIfNone, detectOptional, detectWith, detectWithIfNone, detectWithOptional, each, flatCollect, flatCollect, forEachWith, forEachWithIndex, getFirst, getLast, getOnly, groupBy, groupBy, groupByEach, groupByEach, groupByUniqueKey, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, injectIntoWith, into, isEmpty, iterator, max, max, maxBy, min, min, minBy, noneSatisfy, noneSatisfyWith, notEmpty, partition, partitionWith, reject, reject, rejectWith, rejectWith, remove, removeAll, removeAllIterable, removeIf, removeIfWith, retainAll, retainAllIterable, select, select, selectAndRejectWith, selectInstancesOf, selectWith, selectWith, size, sumByDouble, sumByFloat, sumByInt, sumByLong, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, tap, toArray, toArray, toBag, toBiMap, toList, toMap, toMap, toSet, toSortedBag, toSortedBag, toSortedList, toSortedMap, toSortedMap, toSortedSet, toSortedSet, toString, zip, zip, zipWithIndex, zipWithIndexaggregateBy, aggregateInPlaceBy, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, countBy, countByEach, countByWith, flatCollectWithparallelStream, removeIf, spliterator, streamaggregateBy, appendString, appendString, containsAny, containsAnyIterable, containsBy, containsNone, containsNoneIterable, countBy, countByEach, countByWith, flatCollectBoolean, flatCollectByte, flatCollectChar, flatCollectDouble, flatCollectFloat, flatCollectInt, flatCollectLong, flatCollectShort, flatCollectWith, forEach, getAny, groupByAndCollect, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, makeString, makeString, makeString, makeString, maxByOptional, maxOptional, maxOptional, minByOptional, minOptional, minOptional, reduce, reduceInPlace, reduceInPlace, summarizeDouble, summarizeFloat, summarizeInt, summarizeLong, toImmutableBag, toImmutableBiMap, toImmutableList, toImmutableMap, toImmutableSet, toImmutableSortedBag, toImmutableSortedBag, toImmutableSortedBagBy, toImmutableSortedList, toImmutableSortedList, toImmutableSortedListBy, toImmutableSortedSet, toImmutableSortedSet, toImmutableSortedSetBy, toSortedBagBy, toSortedList, toSortedListBy, toSortedMapBy, toSortedSetByforEachpublic CollectionAdapter(Collection<T> newDelegate)
public MutableCollection<T> asUnmodifiable()
asUnmodifiable in interface MutableCollection<T>public MutableCollection<T> asSynchronized()
asSynchronized in interface MutableCollection<T>public ImmutableCollection<T> toImmutable()
toImmutable in interface MutableCollection<T>public static <E> MutableSet<E> wrapSet(Iterable<E> iterable)
public static <E> MutableList<E> wrapList(Iterable<E> iterable)
public static <E> MutableCollection<E> adapt(Collection<E> collection)
public boolean equals(Object o)
equals in interface Collection<T>equals in class Objectpublic int hashCode()
hashCode in interface Collection<T>hashCode in class Objectpublic CollectionAdapter<T> with(T... elements)
public CollectionAdapter<T> with(T element)
with in interface MutableCollection<T>public CollectionAdapter<T> without(T element)
without in interface MutableCollection<T>public CollectionAdapter<T> withAll(Iterable<? extends T> elements)
withAll in interface MutableCollection<T>public CollectionAdapter<T> withoutAll(Iterable<? extends T> elements)
withoutAll in interface MutableCollection<T>@Deprecated public MutableCollection<T> newEmpty()
FastList.newList() or UnifiedSet.newSet() insteadnewEmpty in interface MutableCollection<T>Copyright © 2004–2022. All rights reserved.