Class FunctionalListParallel

Object
FunctionalListParallel

public class FunctionalListParallel extends Object
Like FunctionalList but executes any operations in parallel where possible.
Author:
Owen Feehan
  • Method Details

    • mapToListOptional

      public static <S, T, E extends Exception> List<T> mapToListOptional(Collection<S> collection, Class<? extends Exception> throwableClass, CheckedFunction<S,Optional<T>,E> mapFunction) throws E
      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 function
      T - return-type for function
      E - an exception that may be thrown by an mapFunction
      Parameters:
      collection - the collection to be mapped.
      throwableClass - class type of exception that may be thrown by mapFunction.
      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 to mapFunction