public final class CollectionHelper extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
CollectionHelper.Partitioner<K,V> |
| Modifier and Type | Method and Description |
|---|---|
static <T> Set<T> |
asSet(T... ts) |
static <T> ArrayList<T> |
newArrayList() |
static <T> ArrayList<T> |
newArrayList(int size) |
static <T> ArrayList<T> |
newArrayList(Iterable<T>... iterables) |
static <K,V> ConcurrentHashMap<K,V> |
newConcurrentHashMap() |
static <K,V> HashMap<K,V> |
newHashMap() |
static <K,V> HashMap<K,V> |
newHashMap(int size) |
static <K,V> HashMap<K,V> |
newHashMap(Map<K,V> map) |
static <T> HashSet<T> |
newHashSet() |
static <T> HashSet<T> |
newHashSet(Collection<? extends T> c) |
static <T> HashSet<T> |
newHashSet(Collection<? extends T> s1,
Collection<? extends T> s2) |
static <T> HashSet<T> |
newHashSet(int size) |
static <T> HashSet<T> |
newHashSet(Iterable<? extends T> iterable) |
static <K,V> Map<K,List<V>> |
partition(List<V> list,
CollectionHelper.Partitioner<K,V> partitioner)
Creates a map containing the given list's values partitioned by the given
partitioner.
|
static <K,V> Map<K,Set<V>> |
partition(Set<V> set,
CollectionHelper.Partitioner<K,V> partitioner)
Creates a map containing the given set's values partitioned by the given
partitioner.
|
static <T> List<T> |
toImmutableList(List<T> list) |
static <K,V> Map<K,V> |
toImmutableMap(Map<K,V> map) |
static <T> Set<T> |
toImmutableSet(Set<T> set) |
public static <K,V> HashMap<K,V> newHashMap()
public static <K,V> HashMap<K,V> newHashMap(int size)
public static <K,V> ConcurrentHashMap<K,V> newConcurrentHashMap()
public static <T> HashSet<T> newHashSet()
public static <T> HashSet<T> newHashSet(int size)
public static <T> HashSet<T> newHashSet(Collection<? extends T> c)
public static <T> HashSet<T> newHashSet(Collection<? extends T> s1, Collection<? extends T> s2)
public static <T> ArrayList<T> newArrayList()
public static <T> ArrayList<T> newArrayList(int size)
@SafeVarargs public static <T> ArrayList<T> newArrayList(Iterable<T>... iterables)
@SafeVarargs public static <T> Set<T> asSet(T... ts)
public static <K,V> Map<K,List<V>> partition(List<V> list, CollectionHelper.Partitioner<K,V> partitioner)
K - The key type of the resulting map.V - The element type of the list to be partitioned.list - The list to be partitioned.partitioner - The partitioner to be used for determining the partitions.public static <K,V> Map<K,Set<V>> partition(Set<V> set, CollectionHelper.Partitioner<K,V> partitioner)
K - The key type of the resulting map.V - The element type of the set to be partitioned.set - The set to be partitioned.partitioner - The partitioner to be used for determining the partitions.Copyright © 2007-2019 Red Hat, Inc. All Rights Reserved