commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henri Yandell <flame...@gmail.com>
Subject Re: ArrayList nullIfEmpty
Date Mon, 07 Sep 2009 19:25:58 GMT
(Presumably the title was meant to be ArrayUtils nullIfEmpty :) )

Best way is to open a JIRA issue up
(http://issues.apache.org/jira/browse/LANG).

The below should be defaultIfEmpty rather than nullIfEmpty I suspect
to match StringUtils/ObjectUtils.

Hen

On Thu, Aug 27, 2009 at 6:48 PM, Guy Rouillier<guyr-ml1@burntmail.com> wrote:
> 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
>
>

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


Mime
View raw message