commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LANG-1411) Add isEmpty method to ObjectUtils
Date Fri, 17 Aug 2018 05:54:00 GMT

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

ASF GitHub Bot commented on LANG-1411:
--------------------------------------

GitHub user nictas opened a pull request:

    https://github.com/apache/commons-lang/pull/342

    LANG-1411: Add empty checks to ObjectUtils

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/nictas/commons-lang master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/commons-lang/pull/342.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #342
    
----
commit a6725c7f66896cc5e44c70aa20d68a24fb93a455
Author: Alexander Tsvetkov <alexander.tsvetkov.93@...>
Date:   2018-08-17T05:47:07Z

    LANG-1411: Add empty checks to ObjectUtils

----


> Add isEmpty method to ObjectUtils
> ---------------------------------
>
>                 Key: LANG-1411
>                 URL: https://issues.apache.org/jira/browse/LANG-1411
>             Project: Commons Lang
>          Issue Type: New Feature
>            Reporter: Alexander Tsvetkov
>            Priority: Major
>
> In Spring's [org.springframework.util.ObjectUtils|https://github.com/spring-projects/spring-framework/blob/master/spring-core/src/main/java/org/springframework/util/ObjectUtils.java] there's
a null-safe [isEmpty method|https://github.com/spring-projects/spring-framework/blob/04141dee65ff5e078e2a9137ff7052351f6ab66c/spring-core/src/main/java/org/springframework/util/ObjectUtils.java#L134] that
checks whether an object is empty based on its type. If the object is a string it calls String.isEmpty,
if it's a collection it calls Collection.isEmpty, etc. I think a similar method would be a
really nice addition to org.apache.commons.lang3.ObjectUtils, as it would allow people like
me to use it without adding a dependency to Spring or re-implementing the method in our code.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message