Collector Variants

Richard Warburton richard.warburton at
Sun Jul 21 12:19:52 PDT 2013


partitioningBy and groupingBy both have a variant with a  default
downstream collector, eg:

public static <T, K> Collector<T, ?, Map<K, List<T>>>
groupingBy(Function<? super T, ? extends K> classifier)

Is there any reason why there is no such equivalent for mapping?  It would
seem to be a fairly common use case (at least from my Collector usage).
 Especially given that I seem to be using mapping as a downstream collector
for groupingBy or partitioningBy rather than anything else.  In which case
why not have the 'leaf' collection default be the same?


  Dr. Richard Warburton
  @RichardWarburto <>

More information about the lambda-dev mailing list