jtulach commented on a change in pull request #2063: Lookup, add optinal support
URL: https://github.com/apache/netbeans/pull/2063#discussion_r403710285
##########
File path: platform/openide.util.lookup/src/org/openide/util/Lookup.java
##########
@@ -228,6 +229,18 @@ private static synchronized void resetDefaultLookup() {
* implementation is found
*/
public abstract <T> T lookup(Class<T> clazz);
+
+ /**
+ * Look up an object matching a given interface, optional version.
+ * Method to support Java Optional.
+ * If more than one object matches, the first will be returned.
+ * @param clazz class of the object we are searching for
+ * @return an optional that contains an object implementing the given
class
+ * or an empty optional if no such implementation is found
Review comment:
Need `@since 8.42`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
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