You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by __matthewHawthorne <mh...@alumni.pitt.edu> on 2003/07/18 18:49:26 UTC
Re: [lang] Pre 2.0 - StringUtils.isEmpty(), isNotEmpty() and stri
ngsa with somespaces
I think it would be easier to have different extensions or wrappers for
StringUtils, such as:
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:flanandowska@yahoo.com]
>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 <tv...@pobox.com> wrote:
>
>
>
>>On 7/15/03 8:12 PM, scolebourne@btopenworld.com 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: commons-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org