Details
-
Improvement
-
Status: Closed
-
Trivial
-
Resolution: Done
-
Jena 3.5.0
Description
Allow a functional approach for returning a default value or throwing a custom exception from a Jena iterator.
The following method may be added to the ExtendedIterator interface.
/** Answer the next object, if it exists, otherwise invoke the _supplier_. */ public default T nextOrElse( Supplier<T> supplier ) { return hasNext() ? next() : supplier.get(); }
Attachments
Issue Links
- links to