Class CollectionUtilities

java.lang.Object
com.strobel.core.CollectionUtilities

public final class CollectionUtilities extends Object
  • Field Details

    • IDENTITY_MAP_SUPPLIER

      private static final Supplier IDENTITY_MAP_SUPPLIER
    • HASH_MAP_SUPPLIER

      private static final Supplier HASH_MAP_SUPPLIER
    • LINKED_HASH_MAP_SUPPLIER

      private static final Supplier LINKED_HASH_MAP_SUPPLIER
    • LIST_SUPPLIER

      private static final Supplier LIST_SUPPLIER
    • SET_SUPPLIER

      private static final Supplier SET_SUPPLIER
  • Constructor Details

    • CollectionUtilities

      public CollectionUtilities()
  • Method Details

    • setFactory

      public static <T> Supplier<Set<T>> setFactory()
    • listFactory

      public static <T> Supplier<List<T>> listFactory()
    • hashMapFactory

      public static <K, V> Supplier<Map<K,V>> hashMapFactory()
    • linekdHashMapFactory

      public static <K, V> Supplier<Map<K,V>> linekdHashMapFactory()
    • identityMapFactory

      public static <K, V> Supplier<Map<K,V>> identityMapFactory()
    • indexOfByIdentity

      public static <T> int indexOfByIdentity(List<?> collection, T item)
    • indexOfByIdentity

      public static <T> int indexOfByIdentity(Iterable<?> collection, T item)
    • indexOf

      public static <T> int indexOf(Iterable<? super T> collection, T item)
    • toList

      public static <T> List<T> toList(Enumeration<T> collection)
    • toList

      public static <T> List<T> toList(Iterable<? extends T> collection)
    • getOrDefault

      public static <T> T getOrDefault(Iterable<T> collection, int index)
    • getOrDefault

      public static <T> T getOrDefault(List<T> collection, int index)
    • get

      public static <T> T get(Iterable<T> collection, int index)
    • get

      public static <T> T get(List<T> list, int index)
    • single

      public static <T> T single(List<T> list)
    • singleOrDefault

      public static <T> T singleOrDefault(List<T> list)
    • single

      public static <T> T single(Iterable<T> collection)
    • first

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

      public static <T> T first(Iterable<T> collection)
    • singleOrDefault

      public static <T> T singleOrDefault(Iterable<T> collection)
    • ofType

      public static <T, R> Iterable<R> ofType(Iterable<T> collection, Class<R> type)
    • firstOrDefault

      public static <T> T firstOrDefault(Iterable<T> collection)
    • first

      public static <T> T first(Iterable<T> collection, Predicate<T> predicate)
    • firstOrDefault

      public static <T> T firstOrDefault(Iterable<T> collection, Predicate<T> predicate)
    • last

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

      public static <T> T last(Iterable<T> collection)
    • lastOrDefault

      public static <T> T lastOrDefault(Iterable<T> collection)
    • firstIndexWhere

      public static <T> int firstIndexWhere(Iterable<T> collection, Predicate<T> predicate)
    • lastIndexWhere

      public static <T> int lastIndexWhere(Iterable<T> collection, Predicate<T> predicate)
    • last

      public static <T> T last(Iterable<T> collection, Predicate<T> predicate)
    • lastOrDefault

      public static <T> T lastOrDefault(Iterable<T> collection, Predicate<T> predicate)
    • contains

      public static <T> boolean contains(Iterable<? super T> collection, T node)
    • any

      public static <T> boolean any(Iterable<T> collection)
    • skip

      public static <T> Iterable<T> skip(Iterable<T> collection, int count)
    • skipWhile

      public static <T> Iterable<T> skipWhile(Iterable<T> collection, Predicate<? super T> filter)
    • take

      public static <T> Iterable<T> take(Iterable<T> collection, int count)
    • takeWhile

      public static <T> Iterable<T> takeWhile(Iterable<T> collection, Predicate<? super T> filter)
    • any

      public static <T> boolean any(Iterable<T> collection, Predicate<? super T> predicate)
    • all

      public static <T> boolean all(Iterable<T> collection, Predicate<? super T> predicate)
    • where

      public static <T> Iterable<T> where(Iterable<T> source, Predicate<? super T> filter)
    • select

      public static <T, R> Iterable<R> select(Iterable<T> source, Selector<? super T,? extends R> selector)
    • hashCode

      public static int hashCode(List<?> sequence)
    • hashCode

      public static int hashCode(Iterable<?> sequence)
    • sequenceEquals

      public static <T> boolean sequenceEquals(List<? extends T> first, List<? extends T> second)
    • sequenceEquals

      public static <T> boolean sequenceEquals(Iterable<? extends T> first, Iterable<? extends T> second)
    • sequenceDeepEquals

      public static <T> boolean sequenceDeepEquals(List<? extends T> first, List<? extends T> second)
    • sequenceDeepEquals

      public static <T> boolean sequenceDeepEquals(Iterable<? extends T> first, Iterable<? extends T> second)
    • sequenceDeepEqualsCore

      private static boolean sequenceDeepEqualsCore(Object first, Object second)
    • toArray

      public static <E> E[] toArray(Class<E> elementType, Iterable<? extends E> sequence)
    • removeAll

      public static <V, K> void removeAll(@NotNull Map<K,V> map, @Nullable List<K> keys)