commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guy Rouillier <guyr-...@burntmail.com>
Subject ArrayList nullIfEmpty
Date Fri, 28 Aug 2009 01:48:43 GMT
I'm new to this list.  I searched the archives and could not find the 
subject method discussed.  Has it ever been proposed?  StringUtils has 
defaultIfEmpty, and ObjectUtils has defaultIfNull, but ObjectUtils 
doesn't have anything similar.  Since ArrayUtils already has all the 
necessary isEmtpy methods defined, the following would appear to be 
sufficient:

public static <T> T[] nullIfEmpty(T[] array) {
   return(isEmpty(array));
}

Thanks.

-- 
Guy Rouillier

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message