NullFriendlyStringUtils or TrimmedStringUtils
Or, maybe a type of StringUtilsFactory that could take the params you suggested and return a corresponding instance.
This situation seems so controversial, with multiple people needing/wanting different behaviors, it seems almost impossible for StringUtils to satisfy everyone. It seems better to keep it simple and let some extensions do the work, in that way, the possibilities could be unlimited.
Thoughts?
Gary Gregory wrote:
What if you could instantiate StringUtils if you did not like the default behavior:
new StringUtils(StringUtils.ALWAYS_TRIM, StringUtils.DISCARD_NULL);
?
Just a random thought.
Gary
-----Original Message-----
From: Lavandowska [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 07:30
To: Jakarta Commons Developers List
Subject: Re: [lang] Pre 2.0 - StringUtils.isEmpty(), isNotEmpty() and stri
ngsa with somespaces
I missed this one earlier, so I guess 2.0 would still work for me, though I find isEmptyTrimmedOrNull() extremely cumbersome.
I'd likely just move to isEmpty( trim( str ) ) myself, rather than use the added method signatures.
Lance
--- Todd Jonker <[EMAIL PROTECTED]> wrote:
On 7/15/03 8:12 PM, [EMAIL PROTECTED] wrote:
Thus I propose:
isEmpty(), true for "", false for null
isEmptyOrNull(), true for "" and null
isEmptyTrimmed(), trim() then true for "", false for null
isEmptyTrimmedOrNull(), trim() then true for "", true for null
__________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
