Re: [lang] ObjectUtils enhancement - consumer with non-null value

2020-12-28 Thread Bindul Bhowmik
0 15:39, Gary Gregory wrote: > > Hi Bindul, > > > > Let's see what this would look like with a PR :-) > > > > Gary > > > > On Mon, Dec 28, 2020, 01:23 Bindul Bhowmik wrote: > > > >> Hi, > >> > >> I would like to propose an e

Re: [lang] ObjectUtils enhancement - consumer with non-null value

2020-12-28 Thread Rob Spoor
ll method myself several times. On 28/12/2020 15:39, Gary Gregory wrote: Hi Bindul, Let's see what this would look like with a PR :-) Gary On Mon, Dec 28, 2020, 01:23 Bindul Bhowmik wrote: Hi, I would like to propose an enhancement to the ObjectUtils class in lang: Background: I hav

Re: [lang] ObjectUtils enhancement - consumer with non-null value

2020-12-28 Thread Gary Gregory
Hi Bindul, Let's see what this would look like with a PR :-) Gary On Mon, Dec 28, 2020, 01:23 Bindul Bhowmik wrote: > Hi, > > I would like to propose an enhancement to the ObjectUtils class in lang: > > Background: I have seen multiple places in code where we have to c

[lang] ObjectUtils enhancement - consumer with non-null value

2020-12-27 Thread Bindul Bhowmik
Hi, I would like to propose an enhancement to the ObjectUtils class in lang: Background: I have seen multiple places in code where we have to check if a value is null before using it in a setter or other method, like: if (valueX != null) { bean.setValue(valueX

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

2018-08-17 Thread Gary Gregory
on for anything that has a "size()" or "length" or "length()" > > > > ? > > > > Gary > > > > > > On Fri, Aug 17, 2018 at 2:43 AM Alexander Tsvetkov < > > alexander.tsvetkov...@gmail.com> wrote: > > > > >

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

2018-08-17 Thread Alexander Tsvetkov
gth" or "length()" > > ? > > Gary > > > On Fri, Aug 17, 2018 at 2:43 AM Alexander Tsvetkov < > alexander.tsvetkov...@gmail.com> wrote: > > > Hi all, > > > > First of all, apologies if I have messed something up - this is my firs

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

2018-08-17 Thread Gary Gregory
gt; > 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 empty respectively) > based on its type: > - CharSequence - Co

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

2018-08-17 Thread Benedikt Ritter
t;: > > > > > 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

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

2018-08-17 Thread Alexander Tsvetkov
sed 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 wou

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

2018-08-17 Thread Benedikt Ritter
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 empty respectively) > based on its type: &g

[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

Re: [lang] [LANG-1360] Add methods to ObjectUtils to get various forms of class names in a null-safe manner

2017-10-21 Thread Allon Mureinik
1:27 AM, Benedikt Ritter > > wrote: > > > >> Hello Gary, > >> > >>> Am 20.10.2017 um 21:19 schrieb ggreg...@apache.org: > >>> > >>> Repository: commons-lang > >>> Updated Branches: > >>> refs/heads/master 88654b79c -&g

Re: [1/2] [lang] Remove ObjectUtils' trailing white spaces

2017-10-21 Thread Gary Gregory
Thanks Benedikt! Gary On Sat, Oct 21, 2017 at 9:33 AM, wrote: > Repository: commons-lang > Updated Branches: > refs/heads/master be3638eb4 -> 6276d0f84 > > > Remove ObjectUtils' trailing white spaces > > Commit 6ea2fc8 inadvertently introduced trailing whi

Re: [lang] [LANG-1360] Add methods to ObjectUtils to get various forms of class names in a null-safe manner

2017-10-21 Thread Benedikt Ritter
ommons-lang >>> Updated Branches: >>> refs/heads/master 88654b79c -> 6ea2fc8d3 >>> >>> >>> [LANG-1360] Add methods to ObjectUtils to get various forms of class >>> names in a null-safe manner >> >> I think this belongs to Cl

Re: [lang] [LANG-1360] Add methods to ObjectUtils to get various forms of class names in a null-safe manner

2017-10-21 Thread Allon Mureinik
itter wrote: > Hello Gary, > > > Am 20.10.2017 um 21:19 schrieb ggreg...@apache.org: > > > > Repository: commons-lang > > Updated Branches: > > refs/heads/master 88654b79c -> 6ea2fc8d3 > > > > > > [LANG-1360] Add methods to ObjectUtils to ge

Re: [lang] [LANG-1360] Add methods to ObjectUtils to get various forms of class names in a null-safe manner

2017-10-21 Thread Benedikt Ritter
Hello Gary, > Am 20.10.2017 um 21:19 schrieb ggreg...@apache.org: > > Repository: commons-lang > Updated Branches: > refs/heads/master 88654b79c -> 6ea2fc8d3 > > > [LANG-1360] Add methods to ObjectUtils to get various forms of class > names in a null-safe m

Re: ObjectUtils

2013-07-08 Thread Matt Benson
ode that I'm refactoring. In > general, I need to check few objects. > > I'm worry about readability. So, I think that isNotNull(obj1, obj2, obj3, > obj4) is more clear and is so readable like String.isNotBlank() that I use > a lot. > > > Rafael Santini > > -

Re: ObjectUtils

2013-07-08 Thread Rafael Santini
obj2, obj3, obj4) is more clear and is so readable like String.isNotBlank() that I use a lot. Rafael Santini -Mensagem Original- From: Matt Benson Sent: Monday, July 08, 2013 2:16 PM To: Commons Developers List Subject: Re: ObjectUtils I don't know exactly why this thread is

Re: ObjectUtils

2013-07-08 Thread Matt Benson
s.firstNonNull() returns the first object that is not null > (equivalent to something that returns true if there is at least one object > that is not null). The isNotNull() returns true if all objects are not null. > > Rafael Santini > > -Mensagem Original----- From

Re: ObjectUtils

2013-07-08 Thread Rafael Santini
ll() returns true if all objects are not null. Rafael Santini -Mensagem Original- From: Matt Benson Sent: Monday, July 08, 2013 1:20 PM To: Commons Developers List Subject: Re: Lang: ObjectUtils WRT #firstNonNull, I don't know why I couldn't find it before. I do now, and I ag

Re: Lang: ObjectUtils

2013-07-08 Thread Matt Benson
WRT #firstNonNull, I don't know why I couldn't find it before. I do now, and I agree it would seem to fit better in ArrayUtils. Matt On Mon, Jul 8, 2013 at 10:04 AM, Jörg Schaible wrote: > Hi Matt, > > Matt Benson wrote: > > > On Mon, Jul 8, 2013 at 8:22 AM, Jörg Schaible > > wrote: > > > >> H

Re: Lang: ObjectUtils

2013-07-08 Thread Jörg Schaible
Hi Matt, Matt Benson wrote: > On Mon, Jul 8, 2013 at 8:22 AM, Jörg Schaible > wrote: > >> Hi Hen, >> >> Henri Yandell wrote: >> >> > I don't see any value having the first two methods - replacing the '==' >> > sign is a bit too far in the 'provide simple methods' direction I think >> :) >> > >>

Re: Lang: ObjectUtils

2013-07-08 Thread Matt Benson
contains(array, null) is fine. Matt > > > Having a containsNull is semantically nice, but I'm not sure it's needed. > > The question is here more, why the method is part of ObjectUtils, since it > operates on an Array and I did not find it immediately (and I am pr

Re: Lang: ObjectUtils

2013-07-08 Thread Jörg Schaible
.contains(array, null); Well, no, this is not, what the method does! With Lang we could use now: ObjectUtils.firstNotNull(array) != null > Having a containsNull is semantically nice, but I'm not sure it's needed. The question is here more, why the method is part of ObjectUti

Re: Lang: ObjectUtils

2013-07-06 Thread Henri Yandell
ly nice, but I'm not sure it's needed. Hen On Thu, Jul 4, 2013 at 11:43 AM, Rafael Santini wrote: > Hi, > > I would like to propose a method in ObjectUtils class that receives an > array of objects and returns true if all objects are not null. I have > implemented the

Re: Lang: ObjectUtils

2013-07-05 Thread Duncan Jones
On 4 July 2013 19:43, Rafael Santini wrote: > Hi, > > I would like to propose a method in ObjectUtils class that receives an array > of objects and returns true if all objects are not null. I have implemented > the following: > > public static boolean isNull(Object object)

Re: Lang: ObjectUtils

2013-07-05 Thread Jörg Schaible
Benedikt Ritter wrote: > You could do this with with CollectionsUtils from [Collections]. > But I think we all agree that implementing a Predicate inline is a lot > more verbose than the proposed method. +1 We have traditionally such convenience methods in lang. When I look at the current argum

Re: Lang: ObjectUtils

2013-07-05 Thread Anshul Zunke
> > > > > > I'd say both are not true. > > > > > > I'm not sure the library should promote that the above is the case. > > > > > > > > > > > > On 07/04/2013 02:43 PM, Rafael Santini wrote: > > >

Re: ObjectUtils

2013-07-04 Thread Romain Manni-Bucau
obj4) { >>>> // Do something... >>>> } >>>> >>>> So I would like something like the isNotNull(Object... objects) method >>>> in >>>> Commons Lang instead of maintain this method in my own framework. >>>> >>&g

Re: ObjectUtils

2013-07-04 Thread Dave Brosius
o: Commons Developers List Subject: Re: Lang: ObjectUtils A bigger question is why this is needed at all. Why not just use composition? In guava, one would do this: Iterables.all(Arrays.asList(**foo), new Predicate() { @Override public boolean apply(Double i

Re: ObjectUtils

2013-07-04 Thread Romain Manni-Bucau
> if (isNotTrue(obj1, obj2, obj3, obj4) { > >>// Do something... > >> } > >> > >> So I would like something like the isNotNull(Object... objects) method > in > >> Commons Lang instead of maintain this method in my own framework. > >> > >

Re: ObjectUtils

2013-07-04 Thread Julien Aymé
t; >> Thanks, >> >> Rafael Santini >> >> -Mensagem Original- From: Ted Dunning >> Sent: Thursday, July 04, 2013 4:34 PM >> To: Commons Developers List >> Subject: Re: Lang: ObjectUtils >> >> A bigger question is why this is needed at all.

Re: ObjectUtils

2013-07-04 Thread Romain Manni-Bucau
, > > Rafael Santini > > -Mensagem Original- From: Ted Dunning > Sent: Thursday, July 04, 2013 4:34 PM > To: Commons Developers List > Subject: Re: Lang: ObjectUtils > > A bigger question is why this is needed at all. > > Why not just use composition? In guav

Re: ObjectUtils

2013-07-04 Thread Rafael Santini
Commons Developers List Subject: Re: Lang: ObjectUtils A bigger question is why this is needed at all. Why not just use composition? In guava, one would do this: Iterables.all(Arrays.asList(foo), new Predicate() { @Override public boolean apply(Double input) {

Re: Lang: ObjectUtils

2013-07-04 Thread Benedikt Ritter
t; > > I'm not sure the library should promote that the above is the case. > > > > > > > > On 07/04/2013 02:43 PM, Rafael Santini wrote: > > > >> Hi, > >> > >> I would like to propose a method in ObjectUtils class t

Re: Lang: ObjectUtils

2013-07-04 Thread Ted Dunning
sure the library should promote that the above is the case. > > > > On 07/04/2013 02:43 PM, Rafael Santini wrote: > >> Hi, >> >> I would like to propose a method in ObjectUtils class that receives an >> array of objects and returns true if all objects are not n

Re: Lang: ObjectUtils

2013-07-04 Thread Dave Brosius
This implies that having arrays with some null elements is a) somewhat common 2) a good idea I'd say both are not true. I'm not sure the library should promote that the above is the case. On 07/04/2013 02:43 PM, Rafael Santini wrote: Hi, I would like to propose a method in O

Lang: ObjectUtils

2013-07-04 Thread Rafael Santini
Hi, I would like to propose a method in ObjectUtils class that receives an array of objects and returns true if all objects are not null. I have implemented the following: public static boolean isNull(Object object) { return object == null; } public static boolean isNotNull(Object object