Class CollectionHelper
java.lang.Object
org.hibernate.validator.internal.util.CollectionHelper
Provides some methods for simplified collection instantiation.
- Author:
- Gunnar Morling, Kevin Pollet <kevin.pollet@serli.com> (C) 2011 SERLI, Hardy Ferentschik, Guillaume Smet
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Set<T>asSet(T... ts) static Iterable<?>iterableFromArray(Object object) Builds anIterablefor a given array.static Iterator<?>iteratorFromArray(Object object) Builds anIteratorfor a given array.static <T> ArrayList<T>static <T> ArrayList<T>newArrayList(int size) static <T> ArrayList<T>newArrayList(Iterable<T>... iterables) static <K,V> ConcurrentHashMap<K, V> static <K,V> HashMap<K, V> static <K,V> HashMap<K, V> newHashMap(int size) static <K,V> HashMap<K, V> newHashMap(Map<K, V> map) static <T> HashSet<T>static <T> HashSet<T>newHashSet(int size) static <T> HashSet<T>newHashSet(Iterable<? extends T> iterable) static <T> HashSet<T>newHashSet(Collection<? extends T> c) static <T> LinkedHashSet<T>static <T> List<T>toImmutableList(List<? extends T> list) static <K,V> Map<K, V> toImmutableMap(Map<K, V> map) static <T> Set<T>toImmutableSet(Set<? extends T> set)
-
Method Details
-
newHashMap
-
newHashMap
-
newHashMap
-
newConcurrentHashMap
-
newHashSet
-
newHashSet
-
newHashSet
-
newHashSet
-
newLinkedHashSet
-
newArrayList
-
newArrayList
-
newArrayList
-
asSet
-
toImmutableList
-
toImmutableSet
-
toImmutableMap
-
iteratorFromArray
Builds anIteratorfor a given array. It is (un)necessarily ugly because we have to deal with array of primitives.- Parameters:
object- a given array- Returns:
- an
Iteratoriterating over the array
-
iterableFromArray
Builds anIterablefor a given array. It is (un)necessarily ugly because we have to deal with array of primitives.- Parameters:
object- a given array- Returns:
- an
Iterableproviding iterators over the array
-