Class MapperListOfLists<T>

java.lang.Object
com.rosetta.model.lib.mapper.MapperListOfLists<T>

public class MapperListOfLists<T> extends Object
  • Constructor Details

  • Method Details

    • of

      public static <T> MapperListOfLists<T> of(List<List<T>> ts)
    • filterList

      public MapperListOfLists<T> filterList(Predicate<MapperC<T>> predicate)
      Filter a list of lists based on the given predicate.
      Parameters:
      predicate - - test that determines whether to filter list item. True to include in list, and false to exclude.
      Returns:
      filtered list
    • filterListNullSafe

      public MapperListOfLists<T> filterListNullSafe(Function<MapperC<T>,Boolean> predicate)
      Filter a list of lists based on the given predicate.
      Parameters:
      predicate - - test that determines whether to filter list item. True to include in list, and false to exclude.
      Returns:
      filtered list
    • mapListToItem

      public <F> MapperC<F> mapListToItem(Function<MapperC<T>,MapperS<F>> mappingFunc)
      Map a list of lists to a list based on the given mapping function.
      Type Parameters:
      F -
      Parameters:
      mappingFunc -
      Returns:
      mapped list
    • mapListToList

      public <F> MapperListOfLists<F> mapListToList(Function<MapperC<T>,MapperC<F>> mappingFunc)
      Map list of lists to a different list of lists based on the given mapping function.
      Type Parameters:
      F -
      Parameters:
      mappingFunc -
      Returns:
      mapped list
    • apply

      public <F> F apply(Function<MapperListOfLists<T>,F> f)
      Apply a function to this mapper
    • flattenList

      public MapperC<T> flattenList()
      Flatten a list of lists to a list.
      Returns:
      flattened list