Class CollectionHelper
- java.lang.Object
-
- org.hibernate.search.util.common.impl.CollectionHelper
-
public final class CollectionHelper extends Object
Provides some methods for simplified collection instantiation.- Author:
- Gunnar Morling, Hardy Ferentschik
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> List<T>asImmutableList(T... items)static <T> Set<T>asImmutableSet(T... items)static <T> Set<T>asLinkedHashSet(T... ts)static <T> List<T>asList(T firstItem, T... otherItems)static <T> Set<T>asSet(T... ts)static <T> Set<T>asSetIgnoreNull(T... ts)static <K,V>
HashMap<K,V>newHashMap(int size)static <T> HashSet<T>newHashSet(int size)static <K,V>
LinkedHashMap<K,V>newLinkedHashMap(int size)static <T> LinkedHashSet<T>newLinkedHashSet(int size)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 Detail
-
newHashMap
public static <K,V> HashMap<K,V> newHashMap(int size)
-
newLinkedHashMap
public static <K,V> LinkedHashMap<K,V> newLinkedHashMap(int size)
-
newHashSet
public static <T> HashSet<T> newHashSet(int size)
-
newLinkedHashSet
public static <T> LinkedHashSet<T> newLinkedHashSet(int size)
-
asSet
@SafeVarargs public static <T> Set<T> asSet(T... ts)
-
asSetIgnoreNull
@SafeVarargs public static <T> Set<T> asSetIgnoreNull(T... ts)
-
asLinkedHashSet
@SafeVarargs public static <T> Set<T> asLinkedHashSet(T... ts)
-
asImmutableSet
@SafeVarargs public static <T> Set<T> asImmutableSet(T... items)
-
asList
@SafeVarargs public static <T> List<T> asList(T firstItem, T... otherItems)
-
asImmutableList
@SafeVarargs public static <T> List<T> asImmutableList(T... items)
-
-