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
>
> -
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
I don't know exactly why this thread is getting split, but I think several
of us are taking the implicit position that we shouldn't necessarily
include a separate utility method for things that can be accomplished with
existing utility methods. It's arguably best that these (and any?) classes
be k
Hi,
The proposed method is related to objects. As we have StringUtils.isBlank(),
isNotBlank(), isEmpty() etc., the ObjectUtils.isNotNull(Object... objs) is
intended to check if all objects are not null. So, instead of
if (obj1 != null && obj2 != null && obj3 != null && obj4 != null) {
// D
But you cant test all are null this way...maybe not that important
Le 5 juil. 2013 07:15, "Dave Brosius" a écrit :
> Nice. Seems like the right solution.
>
> On 07/04/2013 11:20 PM, Julien Aymé wrote:
>
>> Hi,
>>
>> Instead of using a predicate, wouldn't it be simpler to just use
>> if (false ==
Nice. Seems like the right solution.
On 07/04/2013 11:20 PM, Julien Aymé wrote:
Hi,
Instead of using a predicate, wouldn't it be simpler to just use
if (false == Arrays.asList(obj1, obj2, ...).contains(null)) ?
Just my 2 cents,
Julien
2013/7/5 Romain Manni-Bucau :
Hi
I'd just provide a IsNu
Contains(null) doesnt test all values
Le 5 juil. 2013 05:21, "Julien Aymé" a écrit :
> Hi,
>
> Instead of using a predicate, wouldn't it be simpler to just use
> if (false == Arrays.asList(obj1, obj2, ...).contains(null)) ?
>
> Just my 2 cents,
> Julien
>
> 2013/7/5 Romain Manni-Bucau :
> > Hi
>
Hi,
Instead of using a predicate, wouldn't it be simpler to just use
if (false == Arrays.asList(obj1, obj2, ...).contains(null)) ?
Just my 2 cents,
Julien
2013/7/5 Romain Manni-Bucau :
> Hi
>
> I'd just provide a IsNullPredicate class (a singleton) and then use
> commons-collection to select the
Hi
I'd just provide a IsNullPredicate class (a singleton) and then use
commons-collection to select the subcollection and if size is 0 or original
size (depend what you test) it would be true
That said with next java version it will be quite useless IMO
Le 4 juil. 2013 22:04, "Rafael Santini" a
Hi Ted,
I have some codes that needs to test whether a set of objects are all true
or not. For example:
if (obj1 != null && obj2 != null && obj3 != null && obj4 != null) {
// Do something...
}
So, for readability reason, I have replaced for:
if (isNotTrue(obj1, obj2, obj3, obj4) {
// D
10 matches
Mail list logo