On Fri, 3 Jul 2020 at 06:45, Tim Boudreau <[email protected]> wrote:
> A year or two ago I might have +1'd this.  Having used my own lookup-like
> API for something unrelated, that returns Optional, I can relate the
> following:

As mentioned on the PR, like Tim I have a couple of lookup-like APIs
in a few things, in my case that return both Optional and Stream -
similar to

Optional<T> find(Class<T> cls)
Stream<T> findAll(Class<T> cls)

>From a usage and implementation perspective I've found the Stream
variant the more beneficial of the two.

On the PR I was somewhat ambivalent to retrofitting support for this
into Lookup here.  But, having been updating some things with Java 11
over the last couple of months, I'm probably more inclined to +1 now.
Additions to Optional including stream(), or() and ifPresentOrElse()
have made this more useful in the lookup case IMO.  In particular
stream() when starting with findAll on something that is in itself a
lookup source, such as getting a stream of projects and flat mapping
for a particular capability.  Not that we're likely to be able to use
Java 11 APIs in the IDE for a little while longer, but still good for
platform developers.

Best wishes,

Neil

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



Reply via email to