public final class Collections2 extends Object
Collections
and their subclasses/implementations.Modifier and Type | Method and Description |
---|---|
static <V> List<V> |
asImmutableList(V... values)
Copies the values to a new unmodifiable list.
|
static <V> List<V> |
immutableListCopy(List<V> list)
Copies the elements of list to a new unmodifiable list.
|
static <K,V> Map<K,V> |
immutableMapCopy(Map<K,V> map)
Copies the elements of
map to a new unmodifiable map. |
static <T> List<T> |
toImmutableList(Iterable<T> iterable)
Converts the iterable into a new immutable
List . |
static <T> List<T> |
toList(Iterable<T> iterable)
Converts the iterable into a new
List . |
static <T> List<T> |
toList(Iterator<T> iterator)
Creates a
List from the elements remaining in iterator. |
static String |
toString(Iterator<?> iterator)
Creates a human readable string from the remaining elements in iterator.
|
public static <T> List<T> toList(Iterator<T> iterator)
List
from the elements remaining in iterator.public static <T> List<T> toList(Iterable<T> iterable)
List
.public static <T> List<T> toImmutableList(Iterable<T> iterable)
List
.public static <K,V> Map<K,V> immutableMapCopy(Map<K,V> map)
map
to a new unmodifiable map.public static <V> List<V> immutableListCopy(List<V> list)
public static <V> List<V> asImmutableList(V... values)
Copyright © 2023 The Apache Software Foundation. All rights reserved.