Optional.or name <was> Re: RFR 8080418 Add Optional.or()

Tagir F. Valeev amaembo at gmail.com
Mon Oct 12 09:34:01 UTC 2015


Hello!

If my opinion matters, I'm perfectly fine with Optional.or name, no
need to change.

With best regards,
Tagir Valeev.


>> On 25 Sep 2015, at 12:58, Paul Sandoz <Paul.Sandoz at oracle.com> wrote:
>> 
>> Hi,
>> 
>> Please review this change to add a method Optional.or that allows one to better compose optionals:
>> 
>>  http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8080418-optional-or/webrev/
>> 
>> I also took the opportunity to clear up the JavaDoc, it was a little inconsistent and i personally found it harder to read in source code.
>> 

PS> Now that the overall documentation changes and functional
PS> behaviour of Optional.or has been agreed i would like to see if we
PS> can find a better name, suggestions welcome, so lets get our paint brushes out :-)

PS> I suggest we avoid commenting on comments, otherwise this thread could get out of control.

PS> “Optional.or” is the best name so far i have come up with. The
PS> “orElse” prefix is reversed for terminal methods and i don’t want to overload that.

PS> --

PS> Alternative suggestions:

PS> - “Optional.otherwise”
PS> A bit of a mouthful, but reasonably accurate

PS> - “Optional.mapElse"
PS> The name is not entirely accurate since it accepts a Suppler<T>
PS> not a T, a more accurate name would be the following alternative.

PS> - “Optional.flatMapElse"
PS> This name is likely to confuse.

PS> Paul.




More information about the core-libs-dev mailing list