Class CloseableIterators


  • @Beta
    @PublicAPI
    public final class CloseableIterators
    extends Object
    Utility class.

    Please note that this class is marked with @Beta annotation, so it can be subject of incompatible changes or removal in later releases.

    • Method Detail

      • wrapTransformed

        public static <S extends Closeable,​T> CloseableIterator<T> wrapTransformed​(S source,
                                                                                         Function<? super S,​Iterator<T>> transformation)
        Make a CloseableIterator from an Iterator resulting from the transformation of a Closeable.
        Type Parameters:
        S - Type of source which is Closeable and will be transformed into an Iterator
        T - Type of iterated item created by the transformed Iterator
        Parameters:
        source - Source to transform and to close
        transformation - Transformation
        Returns:
        Result