commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Steitz <>
Subject Re: [lang] Pre 2.0 - StringUtils.isEmpty(), isNotEmpty() and stri ngsa with somespaces
Date Tue, 15 Jul 2003 20:34:09 GMT
An alternative to all of the boolean-valued isXXX, isNotXXX methods might be to
introduce an integer-valued classification method to return the rank of a
string according to the ordering

null < "" < whitespace only (but positive length) < "non-trivial".

The syntax would be less natural (maybe to the point of making it 
worthless ;-)), but one method (and maybe some constants) would suffice and the
definition would be unambiguous.

Something like: 

if ((StringUtils.contentClass(myString) <= StringUtils.EMPTY_CONTENT)) or
if ((StringUtils.contentClass(myString) <= StringUtils.contentClass(""))

Though I can't think of immediate uses for this off the top of head, the
ability to compare content classes as in the second example above might turn
out to be useful.

Just a thought.  Admittedly a bit "off thread"...


Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message