Package fr.gouv.vitam.common.collection
Class CloseableIteratorUtils
- java.lang.Object
-
- fr.gouv.vitam.common.collection.CloseableIteratorUtils
-
public final class CloseableIteratorUtils extends java.lang.Object
Helper class for CloseableIterators
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T,R>
CloseableIterator<R>map(CloseableIterator<T> closeableIterator, java.util.function.Function<? super T,? extends R> mapper)
Maps a CloseableIterator from un input type T to an output type R using a mapper function.static <E> CloseableIterator<E>
toCloseableIterator(java.lang.Iterable<E> iterable)
Converts an Iterable to a CloseableIterator.static <E> CloseableIterator<E>
toCloseableIterator(java.util.Iterator<E> iterator)
Converts an Iterator to a CloseableIterator.
-
-
-
Method Detail
-
map
public static <T,R> CloseableIterator<R> map(CloseableIterator<T> closeableIterator, java.util.function.Function<? super T,? extends R> mapper)
Maps a CloseableIterator from un input type T to an output type R using a mapper function.
-
toCloseableIterator
public static <E> CloseableIterator<E> toCloseableIterator(java.util.Iterator<E> iterator)
Converts an Iterator to a CloseableIterator. The close methods does nothing.
-
toCloseableIterator
public static <E> CloseableIterator<E> toCloseableIterator(java.lang.Iterable<E> iterable)
Converts an Iterable to a CloseableIterator. The close methods does nothing.
-
-