API question for point lambdafication
Paul Sandoz
paul.sandoz at oracle.com
Wed Feb 20 01:17:35 PST 2013
On Feb 19, 2013, at 9:50 PM, Brian Goetz <brian.goetz at Oracle.COM> wrote:
> The general advice is "be lenient in what you accept, and specific in
> what you return." Which would argue for returning Stream<String>.
> Unless creating that String is very expensive and avoidable (neither of
> which are necessarily the case.) So I think you're probably better off
> with Stream<String> since that's what people want.
>
i.e. like the existing Pattern.split methods that accept a CharSequence and return String[].
Paul.
More information about the lambda-dev
mailing list