public final class CollectionHelper extends Object
Modifier and Type | Method and Description |
---|---|
static Set<String> |
asImmutableSet(String[] names) |
static <T> Set<T> |
asSet(T... ts) |
static Iterable<?> |
iterableFromArray(Object object)
Builds an
Iterable for a given array. |
static Iterator<?> |
iteratorFromArray(Object object)
Builds an
Iterator for a given array. |
static <T> ArrayList<T> |
newArrayList() |
static <T> ArrayList<T> |
newArrayList(int size) |
static <K,V> HashMap<K,V> |
newHashMap() |
static <K,V> HashMap<K,V> |
newHashMap(int size) |
static <T> HashSet<T> |
newHashSet() |
static <K,V> SortedMap<K,V> |
newSortedMap() |
static <T> List<T> |
toImmutableList(Collection<? extends T> c) |
public static <K,V> HashMap<K,V> newHashMap()
public static <K,V> HashMap<K,V> newHashMap(int size)
public static <K,V> SortedMap<K,V> newSortedMap()
public static <T> HashSet<T> newHashSet()
public static <T> ArrayList<T> newArrayList()
public static <T> ArrayList<T> newArrayList(int size)
public static <T> Set<T> asSet(T... ts)
public static <T> List<T> toImmutableList(Collection<? extends T> c)
public static Iterator<?> iteratorFromArray(Object object)
Iterator
for a given array. It is (un)necessarily ugly because we have to deal with array of primitives.object
- a given arrayIterator
iterating over the arrayCopyright © 2006-2017 Red Hat, Inc. All Rights Reserved