Collectors update
Brian Goetz
brian.goetz at oracle.com
Wed Jan 30 10:21:03 PST 2013
Are there any other comments besides the concern about using arrays for
partition?
On 1/29/2013 5:34 PM, Brian Goetz wrote:
> I've done some refactoring in Collectors to address some issues,
> including approachability issues that were raised by Kevin. See if you
> like them.
>
> 1. Rename to more verby names. We now have
> groupingBy
> groupingReduce
> joiningWith
> partitioningBy
>
> instead of groupBy/mappedTo/partition. This is designed to make it more
> clear what is going on when you read code like:
>
> stream.collect(groupingBy(Foo::getBar))
>
> by making it clear that groupingBy is not an action but a way of
> describing the desired collecting.
>
> 2. Break groupBy into two groups, groupingBy and groupingReduce. While
> the distinction is somewhat arbitrary since groupBy *is* a reduce, it is
> now more consistent with the method naming on Stream.
>
> 3. Rename mappedTo(T->U) to joiningWith.
>
> 4. Rejigger Partition to return an array again, with an explicit lambda
> (which will likely be an array ctor ref) to make the array. Eliminated
> the silly Partition class.
>
> 5. Add more tests -- we now have full test coverage on groupingXxx but
> not yet the others.
More information about the lambda-libs-spec-experts
mailing list