commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Laird J. Nelson" <lairdnel...@comcast.net>
Subject RE: [lang] Proposal (2): isEmpty
Date Sat, 19 Jul 2003 19:34:28 GMT
> -----Original Message-----
> From: Stephen Colebourne [mailto:scolebourne@btopenworld.com]
> It isn't. My preference is now for
>
> isEmpty() - "" or null
> isBlank() - whitespace only, "" or null
> and maybe:
> isEmptyTrimmed() - trim() then "" or null
>
> (plus isNotEmpty, isNotBlank, isEmptyNN, isBlankNN)

Delurking for a moment, but why not have an extra parameter?

Something like: isEmpty(String, boolean) where the boolean indicates
whether trim() should be performed or not?  Then isEmpty(String) could
default to calling it with false as the second parameter.

See, for example,
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/foundry/foundry/foundry/t
ext/Strings.java?rev=1.13&content-type=text/vnd.viewcvs-markup (the
isEmptyOrNull(Object, boolean)) method.

Cheers,
Laird


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


Mime
View raw message