You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Benedikt Ritter (JIRA)" <ji...@apache.org> on 2013/10/16 18:59:42 UTC
[jira] [Commented] (LANG-790) Null safe Navigation in ObjectUtils
[ https://issues.apache.org/jira/browse/LANG-790?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13796978#comment-13796978 ]
Benedikt Ritter commented on LANG-790:
--------------------------------------
This is already possible with BeanUtils. See [PropertyUtils.getNestedProperty(Object, String)|http://commons.apache.org/proper/commons-beanutils/javadocs/v1.8.3/apidocs/index.html]
> Null safe Navigation in ObjectUtils
> -----------------------------------
>
> Key: LANG-790
> URL: https://issues.apache.org/jira/browse/LANG-790
> Project: Commons Lang
> Issue Type: New Feature
> Components: lang.*
> Reporter: Gokul Nanthakumar C
>
> Adding a method for null safe navigation of objects will be very helpful. for example a method like
> ObjectUtils.getValue(Object obj, String "path", String defaultValue);
> ex :ObjectUtils.getValue(myObject, "x.y.z", "default");
> it will navigate in the myObject like myObject.getX().getY().getZ(), if any thing in the path is null (x,y or z), it will return the default value.
> It will be really useful, it is like null safe navigation in groovy.
--
This message was sent by Atlassian JIRA
(v6.1#6144)