You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary D. Gregory (Jira)" <ji...@apache.org> on 2020/01/08 04:03:00 UTC
[jira] [Updated] (LANG-1513) ObjectUtils: Get first non-null
supplier value
[ https://issues.apache.org/jira/browse/LANG-1513?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gary D. Gregory updated LANG-1513:
----------------------------------
Summary: ObjectUtils: Get first non-null supplier value (was: ObjectUtils: Lazy evaluation of firstNonNull)
> ObjectUtils: Get first non-null supplier value
> ----------------------------------------------
>
> 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: 0.5h
> 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)