camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen" <claus.ib...@gmail.com>
Subject Re: Empty or Blank - the choice is here now
Date Tue, 09 Dec 2008 08:44:28 GMT
Hi

If SUN just had much better String and other core utilities to it's
JDK itself !!!
How many people have created their own hasText, notNull, notBlank,
isXXX variations.

We can not use commons-lang as we want to keep camel-core.jar without
dependencies at all.
Currently it only requires commons-logging.jar



/Claus Ibsen
Apache Camel Committer
Blog: http://davsclaus.blogspot.com/



On Tue, Dec 9, 2008 at 9:03 AM, Ramon Buckland <ramon@thebuckland.com> wrote:
> Would it not be better to just use commons-lang:StringUtils ?
>
> http://commons.apache.org/lang/api/org/apache/commons/lang/StringUtils.html
>
> Which has these all already defined  (thus consistent)
>
> On Tue, Dec 9, 2008 at 18:58, <james.strachan@gmail.com> wrote:
>
>> Sounds good. By 'empty' we mean either null or zero length right?
>>
>>
>> On 08/12/2008, Claus Ibsen <claus.ibsen@gmail.com> wrote:
>> > Hi
>> >
>> > Now that we have the chance to change the API for Camel 2.0 I have a
>> > few very minor issues as well.
>> >
>> > We have methods on ObjectHelper for assertions of null and if strings
>> > is provided or not.
>> > We currently have a mix of String assertions methods that use *empty*
>> > or *blank* to indicate if a string is provided or not.
>> >
>> > I think we should align and only use either *blank* or *empty* for
>> > "empty" strings
>> >
>> > Personally I am used to empty
>> >
>> > ObjectHelper.isNotNullOrNonEmpty(String s);
>> > And this cryptic name could be consider renamed to
>> >
>> > ObjectHelper.isNotEmpty(String s);
>> > ObjectHelper.isEmpty(String s);
>> >
>> > We could have just object parameters and if the type is a string we
>> > can do the cast to string and do the trim.length > 0 test.
>> > So we only have these two methods to remember
>> > ObjectHelper.isNotEmpty(Object s);
>> > ObjectHelper.isEmpty(Object s);
>> >
>> > They will test for null and trim strings if its a string type.
>> >
>> > Am I making myself clear?
>> >
>> >
>> > /Claus Ibsen
>> > Apache Camel Committer
>> > Blog: http://davsclaus.blogspot.com/
>> >
>>
>>
>> --
>> James
>> -------
>> http://macstrac.blogspot.com/
>>
>> Open Source Integration
>> http://fusesource.com/
>>
>

Mime
View raw message