Class ListFunctions


  • public final class ListFunctions
    extends java.lang.Object
    Similar to Apache CollectionUtils - but with Generics.
    Author:
    Alex Kalderimis
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T,​R>
      java.util.List<R>
      map​(java.lang.Iterable<T> things, Function<T,​R> f)
      Transform a collection of things into a list of other things.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • map

        public static <T,​R> java.util.List<R> map​(java.lang.Iterable<T> things,
                                                        Function<T,​R> f)
        Transform a collection of things into a list of other things.
        Type Parameters:
        T - The type of the input things.
        R - The type of the output things.
        Parameters:
        things - The things we are transforming.
        f - The function that does the transformation.
        Returns:
        A list of new things