public class CollectionHelper
extends java.lang.Object
Constructor and Description |
---|
CollectionHelper() |
Modifier and Type | Method and Description |
---|---|
static <T> boolean |
anyMatch(java.util.Collection<T> list1,
java.util.Collection<T> list2) |
static <T> boolean |
containsA(java.lang.Iterable<T> container,
java.lang.Class<? extends T> elementClass) |
static <T> boolean |
containsAll(java.util.List<T> baseList,
java.util.List<T> mustHave) |
static <T> boolean |
containsAll(java.util.Set<T> baseList,
java.util.Set<T> mustHave) |
static <T> T |
find(java.lang.Iterable<T> container,
java.util.function.Predicate<T> condition) |
static <T,E extends T> |
getFirst(java.lang.Iterable<T> container,
java.lang.Class<E> elementClass) |
static <T> T |
getRandomElement(java.util.List<T> list) |
static <T> T |
getRandomElement(java.util.Set<T> set) |
static <T,E extends T> |
removeAny(java.util.List<T> list,
java.lang.Class<E> clazz) |
static <K,V> java.util.List<K> |
reverseMapGet(java.util.Map<K,V> map,
V value) |
static <T> boolean |
some(java.lang.Iterable<T> container,
java.util.function.Predicate<T> condition) |
static <T> T[] |
stripNulls(java.lang.Class<T> clazz,
T... array) |
public static <K,V> java.util.List<K> reverseMapGet(java.util.Map<K,V> map, V value)
public static <T> T getRandomElement(java.util.List<T> list)
public static <T> T getRandomElement(java.util.Set<T> set)
public static <T> boolean anyMatch(java.util.Collection<T> list1, java.util.Collection<T> list2)
public static <T> boolean containsAll(java.util.List<T> baseList, java.util.List<T> mustHave)
public static <T> boolean containsAll(java.util.Set<T> baseList, java.util.Set<T> mustHave)
public static <T> boolean containsA(java.lang.Iterable<T> container, java.lang.Class<? extends T> elementClass)
@Nullable public static <T,E extends T> E getFirst(java.lang.Iterable<T> container, java.lang.Class<E> elementClass)
public static <T,E extends T> void removeAny(java.util.List<T> list, java.lang.Class<E> clazz)
@Nullable public static <T> T find(java.lang.Iterable<T> container, java.util.function.Predicate<T> condition)
public static <T> boolean some(java.lang.Iterable<T> container, java.util.function.Predicate<T> condition)
public static <T> T[] stripNulls(java.lang.Class<T> clazz, T... array)