commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Benson (JIRA)" <j...@apache.org>
Subject [jira] [Issue Comment Edited] (LANG-694) ObjectUtils.defaultIfNotNull
Date Wed, 20 Apr 2011 15:15:05 GMT

    [ https://issues.apache.org/jira/browse/LANG-694?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13022161#comment-13022161
] 

Matt Benson edited comment on LANG-694 at 4/20/11 3:13 PM:
-----------------------------------------------------------

or:
{{return object1 == null ? null : anotherObject;}}

I must say this request doesn't really resonate with me.

      was (Author: mbenson):
    or:
{{return object1 == null ? null : anotherObject;}}

I must say this request doesn't really make that much sense to me.
  
> ObjectUtils.defaultIfNotNull
> ----------------------------
>
>                 Key: LANG-694
>                 URL: https://issues.apache.org/jira/browse/LANG-694
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>         Environment: all
>            Reporter: Ivan Hristov
>            Priority: Minor
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> Currently there is a defaultIfNull method in ObjectUtils, which is a great one, but it
will be nice to have an additional method called defaultIfNotNull which returns null if the
first parameter is null or the second parameter if the object is not null. 
> ObjectUtils.defaultIfNotNull(object1, anotherObject);
> For the moment I have to perform a null comparison on my own,e.g., 
> if (object1 == null) {
> return null;
> }
> return anotherObject;

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message