Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Add org.apache.commons.lang3.ObjectUtils.getFirstNonNull(Supplier<T>...)
\ObjectUtils.firstNonNull takes values, and returns the first non null. This is often used when multiple options have to be tried one after another.
When each option is expensive to compute, you don't want to calculate them all beforehand, but only evaluate them when needed. For this I propose firstNonNullLazy, which takes a Supplier and only evaluates the value if it needs to be checked.
Attachments
Issue Links
- links to