Hello:

I was looking for a method that adds a object in a Collection 
if this object is not null, but I did not find it in
Collections. I thought that this method would be useful in
CollectionUtils class. Is there a method like this? If it
does not exist I would like suggest this. It could be
implemented like this:

public static boolean addNotNull(Collection c, Object o) {
   return (o != null)? c.add(o): false;
}

Like Collection.add(Object) returns boolean, this method will
boolean too.
What is your opinion?

Thanks,

Rafael Ubiratam Clemente Afonso
[EMAIL PROTECTED]
---------------------------------
Where is Debug?
Debug is on the Table!
 
__________________________________________________________________________
Acabe com aquelas janelinhas que pulam na sua tela.
AntiPop-up UOL - � gr�tis!
http://antipopup.uol.com.br/



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to