Objects.firstNonNull

Brian Goetz brian.goetz at oracle.com
Wed Mar 20 11:51:04 PDT 2013


Or you could write your own in two lines.

On 3/20/2013 2:33 PM, Michael Nascimento wrote:
> Hi guys,
>
> Since Map.getOrDefault has been added (yes!!!), couldn't a
> Objects.firstNonNull that works like Guava's one:
>
> http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/base/Objects.html#firstNonNull(T,
> T)
>
> Then all uses of Objects.firstNonNull would be gone from my code base.
>
> Regards,
> Michael
>


More information about the lambda-dev mailing list