StringJoiner in b88

Joe Bowbeer joe.bowbeer at gmail.com
Fri May 17 00:32:14 PDT 2013


Previously, when StringJoiner was a stream destination, I could collect
into one using the three-arg variant:

  s.into(new StringJoiner(delimiter, prefix, suffix));

For example:

  elements.into(new StringJoiner(", ", "[", "]"));

But I can't now because Collectors.toStringJoiner(delimiter) is the only
option.

What's the recommended workaround?

Should Collectors.toStringJoiner(delimiter, prefix, suffix) be added?



On Mon, May 6, 2013 at 5:56 AM, Brian Goetz <brian.goetz at oracle.com> wrote:

> There has not been a "stream destination" type or an "into" method for a
> very long time.
>
> But, if you want to use a string joiner as a stream target, do:
>
>   stream.collect(toStringJoiner(**));
>
>
> On 5/6/2013 3:19 AM, Joe Bowbeer wrote:
>
>> In b88, StringJoiner does not implement a stream destination?
>>
>> Is the "into" example in the javadoc no longer valid?
>>
>> http://download.java.net/**lambda/b88/docs/api/java/util/**
>> StringJoiner.html<http://download.java.net/lambda/b88/docs/api/java/util/StringJoiner.html>
>>
>> Joe
>>
>


More information about the lambda-libs-spec-observers mailing list