Class CollectionUtil


  • public class CollectionUtil
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      CollectionUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> java.util.Enumeration<T> createEnumerationFromIterator​(java.util.Iterator<T> it)
      Creates an Enumeration out of the given Iterator.
      static <T> T first​(java.util.List<T> list)
      Returns the first element of the list, null if the list is null or empty.
      static boolean isEmpty​(java.util.Collection<?> collection)
      Whether the given collection is null or has no elements.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CollectionUtil

        public CollectionUtil()
    • Method Detail

      • createEnumerationFromIterator

        public static <T> java.util.Enumeration<T> createEnumerationFromIterator​(java.util.Iterator<T> it)
        Creates an Enumeration out of the given Iterator.
        Type Parameters:
        T -
        Parameters:
        it -
        Returns:
        an Enumeration created out of the given Iterator.
      • first

        public static <T> T first​(java.util.List<T> list)
        Returns the first element of the list, null if the list is null or empty.
        Type Parameters:
        T -
        Parameters:
        list -
        Returns:
        the first element of the list, null if the list is null or empty.
      • isEmpty

        public static boolean isEmpty​(java.util.Collection<?> collection)
        Whether the given collection is null or has no elements.
        Parameters:
        collection -
        Returns:
        Whether the given collection is null or has no elements.