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, aggregateBy, aggregateInPlaceBy, allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, asLazy, chunk, clear, collect, collect, collectBoolean, collectBoolean, collectByte, collectByte, collectChar, collectChar, collectDouble, collectDouble, collectFloat, collectFloat, collectIf, collectIf, collectInt, collectInt, collectLong, collectLong, collectShort, collectShort, collectWith, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, count, countWith, detect, detectIfNone, detectOptional, detectWith, detectWithIfNone, detectWithOptional, each, flatCollect, flatCollect, forEach, 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, toSortedBagBy, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSet, toSortedSet, toSortedSetBy, toString, zip, zip, zipWithIndex, zipWithIndexcountBy, countByEach, countByWith, flatCollectWithparallelStream, removeIf, spliterator, streamappendString, appendString, countBy, countByEach, countByWith, flatCollectWith, getAny, groupByAndCollect, makeString, makeString, makeString, maxByOptional, maxOptional, maxOptional, minByOptional, minOptional, minOptional, reduce, reduceInPlace, reduceInPlace, summarizeDouble, summarizeFloat, summarizeInt, summarizeLong, toSortedListforEachpublic 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–2020. All rights reserved.