Re: RFE: add missing methods to Optional, OptionalInt, OptionalLong and OptionalDouble

2019-02-20 Thread Rob Spoor
I was actually missing at least one of the map methods. I have a method that is returning an OptionalInt, and I wanted to easily turn that into an Optional by applying mapToObj(Integer::valueOf). The same could also be done for OptionalLong -> Optional and OptionalDouble -> Optional.

Re: RFE: add missing methods to Optional, OptionalInt, OptionalLong and OptionalDouble

2019-02-19 Thread Brian Goetz
This is a very nice patch, complete with spec and tests, and evidence of OCA. But, before we talk about patches and code, let's step back and talk about stewardship.  With API proposals, we like to start with problems, rather than solutions: what problems we are concerned with, and are these

RFE: add missing methods to Optional, OptionalInt, OptionalLong and OptionalDouble

2019-02-16 Thread Rob Spoor
I noticed that, while Stream and its primitive equivalents have multiple map and flapMap methods, Optional and its primitive equivalents were missing those. Since these can still be very useful, I wrote a patch to add the following methods: * Optional: mapToInt, mapToLong, mapToDouble,