Loose ends: Optional
forax at univ-mlv.fr
Sun Jun 2 12:15:26 PDT 2013
On 06/02/2013 06:56 PM, Brian Goetz wrote:
>>> I still struggle with the fact that with the current API I still have to make my own object to Optional converter to handle nulls in what I think is a sane way.
>> yes, Optional have not the same semantics as Optional (from Guava).
> Can you clarify this? Is this anything more than the lack of an Optional.ofNullable(T) factory?
But if you add that, you will have code like this:
List<Optional<Badge>> bagdes = people.streams().map(p ->
That's why I was against Optional since the beginning, because if you
the whole community will have to deal with beast like the one above.
Trading a null to an Optional doesn't solve the issue, filtering the
null out the of stream is the solution:
List<Badge> badges = people.streams().map(p ->
More information about the lambda-libs-spec-experts