public class CollectionUtils extends Object
| Constructor and Description |
|---|
CollectionUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <T> List<T> |
createImmutableList(List<T> list) |
static <T> List<T> |
createImmutableList(T... elements) |
static <K,V> Map<K,V> |
createImmutableMap(K key,
V value) |
static <K,V> Map<K,V> |
createImmutableMap(Map<K,V> map) |
static <K,V> Map<K,V> |
createImmutableMap(Pair<K,V>... elements) |
static <T> Set<T> |
createImmutableSet(Set<T> set) |
static <T> Set<T> |
createImmutableSet(T... elements) |
static <T> Set<T> |
createSet(T... elements) |
static boolean |
elementsEqual(Iterator<?> iterator1,
Iterator<?> iterator2)
Determines whether two iterators contain equal elements in the same order.
|
public static boolean elementsEqual(Iterator<?> iterator1, Iterator<?> iterator2)
true if iterator1 and iterator2 contain the same
number of elements and every element of iterator1 is equal to the corresponding element
of iterator2.
Note that this will modify the supplied iterators, since they will have been advanced some number of elements forward.
@SafeVarargs public static <T> Set<T> createSet(T... elements)
public static <K,V> Map<K,V> createImmutableMap(K key, V value)
@SafeVarargs public static <T> List<T> createImmutableList(T... elements)
@SafeVarargs public static <K,V> Map<K,V> createImmutableMap(Pair<K,V>... elements)
@SafeVarargs public static <T> Set<T> createImmutableSet(T... elements)
Copyright © 2021 The Apache Software Foundation. All rights reserved.