Package com.persequor
Class IteratorUtils
java.lang.Object
com.persequor.IteratorUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T,
E extends Exception>
voideach
(Iterable<T> iterable, ThrowingConsumer<T, E> consumer) Do action for each element
-
Constructor Details
-
IteratorUtils
public IteratorUtils()
-
-
Method Details
-
each
public static <T,E extends Exception> void each(Iterable<T> iterable, ThrowingConsumer<T, E> consumer) throws EDo action for each element- Type Parameters:
T
- type of element to processE
- type of exception thrown by consumer- Parameters:
iterable
- element to processconsumer
- action to perform with each element- Throws:
E
- exception thrown by the provided consumer
-