You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Bernhard Bonigl (Jira)" <ji...@apache.org> on 2020/01/07 10:21:00 UTC
[jira] [Updated] (LANG-1513) ObjectUtils: Lazy evaluation of
firstNonNull
[ https://issues.apache.org/jira/browse/LANG-1513?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bernhard Bonigl updated LANG-1513:
----------------------------------
External issue ID: 484
External issue URL: https://github.com/apache/commons-lang/pull/484
> ObjectUtils: Lazy evaluation of firstNonNull
> --------------------------------------------
>
> Key: LANG-1513
> URL: https://issues.apache.org/jira/browse/LANG-1513
> Project: Commons Lang
> Issue Type: New Feature
> Components: lang.*
> Reporter: Bernhard Bonigl
> Priority: Major
> Time Spent: 10m
> Remaining Estimate: 0h
>
> {{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.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)