Class IterableUtils


  • public final class IterableUtils
    extends Object
    Iterable utilities.
    Author:
    Adrian Herscu
    • Method Detail

      • iterable

        public static <T> Iterable<T> iterable​(Iterator<T> iterator)
        Type Parameters:
        T - iterated type
        Parameters:
        iterator - the iterator to wrap
        Returns:
        the iterable over specified iterator
      • toString

        public static List<String> toString​(Iterable<?> i)
        Converts an iterable of objects to a list of strings by calling String.toString() on each element.
        Parameters:
        i - the iterable
        Returns:
        the list of strings