commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Steitz <stei...@yahoo.com>
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"...

Phil



__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

---------------------------------------------------------------------
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