Marshall Schor commented on UIMA-5115:

I didn't follow the example get().get().  I think the first get() would return 
the single element or null, and the 2nd get would not compile (since FS doesn't 
have a "get" method.  

The small value in Optional (seems "documentational", only, to me) is 
outweighed (IMHO) by it's verbosity and inefficiency (creating an extra Java 
object wrapping things).  But I certainly could be missing something...

The single(true), single(false) forms communicate less to the reader than 
singleOrNull and single.  Other forms which might communicate well include 
nullOk().single().  But that seems somewhat stilted.  It might be useful if 
there are other methods where sometimes null is OK and other times you want to 
throw an exception.

> uv3 select() api for iterators and streams over CAS contents
> ------------------------------------------------------------
>                 Key: UIMA-5115
>                 URL: https://issues.apache.org/jira/browse/UIMA-5115
>             Project: UIMA
>          Issue Type: New Feature
>          Components: Core Java Framework
>            Reporter: Marshall Schor
>            Priority: Minor
>             Fix For: 3.0.0SDKexp
> Design and implement a select() API based on uimaFIT's select, integrated 
> well with Java 8 concepts.  Initial discussions in UIMA-1524.  Wiki with 
> diagram: https://cwiki.apache.org/confluence/display/UIMA/UV3+Iterator+support

This message was sent by Atlassian JIRA

Reply via email to