Class CollectionHelper

java.lang.Object
com.pixelmonmod.pixelmon.api.util.helpers.CollectionHelper

public class CollectionHelper extends Object
  • Constructor Details

    • CollectionHelper

      public CollectionHelper()
  • Method Details

    • reverseMapGet

      public static <K, V> List<K> reverseMapGet(Map<K,V> map, V value)
    • getRandomElement

      public static <T> T getRandomElement(List<T> list)
    • getRandomElement

      public static <T> T getRandomElement(Set<T> set)
    • anyMatch

      public static <T> boolean anyMatch(Collection<T> list1, Collection<T> list2)
    • containsAll

      public static <T> boolean containsAll(List<T> baseList, List<T> mustHave)
    • containsAll

      public static <T> boolean containsAll(Set<T> baseList, Set<T> mustHave)
    • containsA

      public static <T> boolean containsA(Iterable<T> container, Class<? extends T> elementClass)
    • getFirst

      @Nullable public static <T, E extends T> E getFirst(Iterable<T> container, Class<E> elementClass)
    • removeAny

      public static <T, E extends T> void removeAny(List<T> list, Class<E> clazz)
    • find

      @Nullable public static <T> T find(Iterable<T> container, Predicate<T> condition)
    • some

      public static <T> boolean some(Iterable<T> container, Predicate<T> condition)
    • stripNulls

      public static <T> T[] stripNulls(Class<T> clazz, T... array)