Class CollectionHelper
java.lang.Object
org.hibernate.search.util.common.impl.CollectionHelper
Provides some methods for simplified collection instantiation.
- Author:
- Gunnar Morling, Hardy Ferentschik
-
Method Summary
Modifier and TypeMethodDescriptionstatic <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 <T> Set<T>asTreeSet(T... ts) static <T> Set<? extends T>flattenAsSet(Collection<? extends Collection<? extends T>> input) static <T> booleanstatic <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> Set<T>notInTheOtherSet(Set<T> subset, Set<T> superset) 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
-
newLinkedHashMap
-
newHashSet
-
newLinkedHashSet
-
asSet
-
asSetIgnoreNull
-
asLinkedHashSet
-
asTreeSet
-
asImmutableSet
-
asList
-
asImmutableList
-
toImmutableList
-
toImmutableSet
-
toImmutableMap
-
flattenAsSet
public static <T> Set<? extends T> flattenAsSet(Collection<? extends Collection<? extends T>> input) -
isSubset
- Returns:
- Whether all elements that are present in the first set are available in the second one.
-
notInTheOtherSet
-