You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OptionalCollector is the collector specialization which return type is Optional<R> and it has methods which mimic the optional behavior (like orElse, orElseGet, get, map, filter, etc.). Should support both short-circuiting and non-short-circuiting collection.
The text was updated successfully, but these errors were encountered:
No, the idea was to create a separate public type OptionalCollector, so you can do something like MoreCollectors.onlyOne().orElse("foo") as a shortcut to Collectors.collectingAndThen(MoreCollectors.onlyOne(), opt -> opt.orElse("foo")). Not sure whether it worth the effort though.
OptionalCollector is the collector specialization which return type is
Optional<R>
and it has methods which mimic the optional behavior (likeorElse
,orElseGet
,get
,map
,filter
, etc.). Should support both short-circuiting and non-short-circuiting collection.The text was updated successfully, but these errors were encountered: