Class FunctionalListParallel
Object
FunctionalListParallel
Like
FunctionalList
but executes any operations in parallel where possible.- Author:
- Owen Feehan
-
Method Summary
Modifier and TypeMethodDescriptionmapToListOptional
(Collection<S> collection, Class<? extends Exception> throwableClass, CheckedFunction<S, Optional<T>, E> mapFunction) Maps a collection to a list with each element in the original collection maybe producing an element in the output.
-
Method Details
-
mapToListOptional
public static <S,T, List<T> mapToListOptionalE extends Exception> (Collection<S> collection, Class<? extends Exception> throwableClass, CheckedFunction<S, Optional<T>, throws EE> mapFunction) Maps a collection to a list with each element in the original collection maybe producing an element in the output.- Type Parameters:
S
- parameter-type for functionT
- return-type for functionE
- an exception that may be thrown by anmapFunction
- Parameters:
collection
- the collection to be mapped.throwableClass
- class type of exception that may be thrown bymapFunction
.mapFunction
- function to do the mapping to an Optional (the item is included in the output if the optional is defined).- Returns:
- a list with the same size and same order, but using derived elements that are a result of the mapping.
- Throws:
E
- if it is thrown by any call tomapFunction
-