Add convenience collect methods to the Stream interface
brian.goetz at oracle.com
Mon Dec 10 16:15:25 UTC 2018
FTR: already tracking as JDK-8180352.
On 12/9/2018 5:44 PM, Rob Griffin (rgriffin) wrote:
> I have raised an enhancement request (Incident Report 913453) about adding some convenience methods to the Stream interface that collect the stream and Pallavi Sonal asked me to start a thread here about that.
> More than 50% of our Stream collect calls use Collectors.toList() or Collectors.toSet() as arguments so I think it would be very handy if the Stream interface had default collectToList and collectToList and collectToMap methods.
> The advantages are:
> it would be easier to use code completion in IDEs. There are lot of classes starting with Collect so finding the Collectors class is a bit of a pain.
> one less method call in what is usually a long chain of calls.
> Rob Griffin
> Software Analyst, Spotlight on SQL Server
> Quest | R&D
> rob.griffin at quest.com
More information about the core-libs-dev