What methods should go into a java.util.Objects class in JDK 7?

Paul Benedict pbenedict at apache.org
Mon Nov 16 14:34:50 UTC 2009


I agree with Stephen that the Elvis operator should have been included.

Regardless, I think the proposed method is still a common idiom worth
having. It might not "save any keystrokes", but it's a certain way of
not flubbing ternary logic or a verbose if-else statement.

By the way, this is a lot easier than writing out the native logic check:
defaultIfNull(a, defaultIfNull(b, c));

Paul



More information about the core-libs-dev mailing list