Class CollectionUtils

java.lang.Object
org.jobrunr.utils.CollectionUtils

public class CollectionUtils extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> ArrayList<T>
    asArrayList(Collection<T> existingCollection)
     
    static <T> List<T>
    asList(T[] array, T... params)
     
    static <T> Set<T>
    asSet(Collection<T>... existingCollections)
     
    static <T> Set<T>
    asSet(T... items)
     
    static <T> Optional<T>
    findFirst(List<T> items)
     
    static <T> Optional<T>
    findLast(List<T> items)
     
    static <T> T
    getFirst(List<T> items)
     
    static <T> T
    getLast(List<T> items)
     
    static <T> boolean
     
    static <T> boolean
    isNotNullOrEmpty(T[] someArray)
     
    static <T> boolean
    isNullOrEmpty(Collection<T> collection)
     
    static <T> boolean
    isNullOrEmpty(T[] someArray)
     
    static <K,V> Map<K,V>
    mapOf(K key1, V value1)
     
    static <K,V> Map<K,V>
    mapOf(K key1, V value1, K key2, V value2)
     
    static <K,V> Map<K,V>
    mapOf(K key1, V value1, K key2, V value2, K key3, V value3)
     
    static <K,V> Map<K,V>
    mapOf(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4)
     
    static <K,V> Map<K,V>
    mapOf(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4, K key5, V value5)
     
    static <K,V> Map<K,V>
    mapOf(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4, K key5, V value5, K key6, V value6)
     
    static <K,V> Map<K,V>
    mapOf(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4, K key5, V value5, K key6, V value6, K key7, V value7)
     
    static <K,V> Map<K,V>
    mapOf(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4, K key5, V value5, K key6, V value6, K key7, V value7, K key8, V value8)
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • isNotNullOrEmpty

      public static <T> boolean isNotNullOrEmpty(Collection<T> collection)
    • isNullOrEmpty

      public static <T> boolean isNullOrEmpty(Collection<T> collection)
    • isNotNullOrEmpty

      public static <T> boolean isNotNullOrEmpty(T[] someArray)
    • isNullOrEmpty

      public static <T> boolean isNullOrEmpty(T[] someArray)
    • asList

      @SafeVarargs public static <T> List<T> asList(T[] array, T... params)
    • asArrayList

      public static <T> ArrayList<T> asArrayList(Collection<T> existingCollection)
    • asSet

      @SafeVarargs public static <T> Set<T> asSet(T... items)
    • asSet

      @SafeVarargs public static <T> Set<T> asSet(Collection<T>... existingCollections)
    • findFirst

      public static <T> Optional<T> findFirst(List<T> items)
    • findLast

      public static <T> Optional<T> findLast(List<T> items)
    • getFirst

      public static <T> T getFirst(List<T> items)
    • getLast

      public static <T> T getLast(List<T> items)
    • mapOf

      public static <K,V> Map<K,V> mapOf(K key1, V value1)
    • mapOf

      public static <K,V> Map<K,V> mapOf(K key1, V value1, K key2, V value2)
    • mapOf

      public static <K,V> Map<K,V> mapOf(K key1, V value1, K key2, V value2, K key3, V value3)
    • mapOf

      public static <K,V> Map<K,V> mapOf(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4)
    • mapOf

      public static <K,V> Map<K,V> mapOf(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4, K key5, V value5)
    • mapOf

      public static <K,V> Map<K,V> mapOf(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4, K key5, V value5, K key6, V value6)
    • mapOf

      public static <K,V> Map<K,V> mapOf(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4, K key5, V value5, K key6, V value6, K key7, V value7)
    • mapOf

      public static <K,V> Map<K,V> mapOf(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4, K key5, V value5, K key6, V value6, K key7, V value7, K key8, V value8)