Closed GoogleCodeExporter closed 9 years ago
fluentIterable.onlyMatch(predicate) would be equivalent to
fluentIterable.filter(predicate).only(), wouldn't it?
Original comment by SeanPFl...@googlemail.com
on 25 Sep 2013 at 4:25
Indeed, given that it should return `Optional` instead of throwing exceptions.
Then again, I'm not sure if `matchOnly` would allow the implementation to take
a shortcut in order to exit early (in the case of multiple matching elements)
after the predicate returned true twice.
Original comment by j...@nwsnet.de
on 25 Sep 2013 at 7:25
filter(predicate) is lazy, so filter(predicate).only() would get that same
"shortcut" for free anyway.
Original comment by lowas...@google.com
on 25 Sep 2013 at 7:28
Original comment by kak@google.com
on 25 Sep 2013 at 7:30
only()
and onlyMatch(Predicate<? super E> predicate)
to FluentIterable
.Original comment by lowas...@google.com
on 25 Sep 2013 at 7:46
Ah, wasn't completely sure about the laziness.
Original comment by j...@nwsnet.de
on 25 Sep 2013 at 9:51
This issue has been migrated to GitHub.
It can be found at https://github.com/google/guava/issues/<issue id>
Original comment by cgdecker@google.com
on 1 Nov 2014 at 4:12
Original comment by cgdecker@google.com
on 3 Nov 2014 at 9:08
Original issue reported on code.google.com by
j...@nwsnet.de
on 25 Sep 2013 at 4:23