Provide a more convenient method - getOnlyValue

17 views
Skip to first unread message

du zhilin

unread,
Feb 23, 2022, 12:26:06 PM2/23/22
to Jinq
When I call getOnlyValue(), it will first query all the results.

I expected getOnlyValue() to be called, which behaves the same as limit(1).getOnlyValue().

Jinq

unread,
Feb 23, 2022, 9:03:41 PM2/23/22
to Jinq
I've followed your suggestion from elsewhere and overridden findFirst() that's already defined in Stream. findFirst() will call limit() before returning the expected result.

I've made this change to the 2.0 version of Jinq, which is pending release until someone says they specifically need a version of Jinq that uses the new jakarta.* packages. If you need me to backport this change to the 1.* release of Jinq, just let me know, and I can do that.




Reply all
Reply to author
Forward
0 new messages