Re: [LANG] Adding isEmpty and isNotEmpty methods to ObjectUtils

2018-08-17 Thread Gary Gregory
I must admit to playing a bit of devil's advocate here ;-) with my laundry list of sizeable kind of objects but I am sure you get my point: As soon as we add a method like this, the we will get requests for adding more to it release after release. I'm not against it, but it make you wonder about ad

Re: [LANG] Adding isEmpty and isNotEmpty methods to ObjectUtils

2018-08-17 Thread Alexander Tsvetkov
Hi Gary, Yes, you can make the argument that the user might expect *every* class with a length(), size() or isEmpty() method to be covered by the implementation, but IMO as long as the Javadoc clearly states what is supported and what is not, then it's better to have at least a partial implementat

Re: [LANG] Adding isEmpty and isNotEmpty methods to ObjectUtils

2018-08-17 Thread Gary Gregory
If we open that Pandora's box, then I want to add: - File, empty if length is 0 - Path, empty if name length is 0 - Buffer, what? - StringBuffer - StringBuilder - java.sql.Clob - java.sql.Lob - The content of an AtomicReference - ZipFile - on and on for anything that has a "size()" or "length" or

Re: [LANG] Adding isEmpty and isNotEmpty methods to ObjectUtils

2018-08-17 Thread Benedikt Ritter
Hello Alexander, Am Fr., 17. Aug. 2018 um 15:09 Uhr schrieb Alexander Tsvetkov < alexander.tsvetkov...@gmail.com>: > Hi Benedikt, > > Yes, ObjectUtils.isEmpty(null) would return true. You can review the pull > request (https://github.com/apache/commons-lang/pull/342) if you'd like to > see the en

Re: [LANG] Adding isEmpty and isNotEmpty methods to ObjectUtils

2018-08-17 Thread Alexander Tsvetkov
Hi Benedikt, Yes, ObjectUtils.isEmpty(null) would return true. You can review the pull request (https://github.com/apache/commons-lang/pull/342) if you'd like to see the entire implementation in its current state. Thanks and best regards, Alexander 2018-08-17 15:41 GMT+03:00 Benedikt Ritter : >

Re: [LANG] Adding isEmpty and isNotEmpty methods to ObjectUtils

2018-08-17 Thread Benedikt Ritter
Hello Alexander, welcome to the mailing list and thanks for your contribution. Am Fr., 17. Aug. 2018 um 10:43 Uhr schrieb Alexander Tsvetkov < alexander.tsvetkov...@gmail.com>: > Hi all, > > First of all, apologies if I have messed something up - this is my first > attempt at contributing to Apa

[LANG] Adding isEmpty and isNotEmpty methods to ObjectUtils

2018-08-17 Thread Alexander Tsvetkov
Hi all, First of all, apologies if I have messed something up - this is my first attempt at contributing to Apache. With that said, I'd like to propose adding two new methods to Commons Lang's ObjectUtils class: - isEmpty() - isNotEmpty() These would check whether the object is empty (or not