commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henri Yandell <bay...@generationjava.com>
Subject Re: [lang] [patch] StringUtils.defaultString
Date Wed, 23 Oct 2002 01:59:32 GMT
Managed to get them out. Edited the mailbox by hand and it seemed to work.
Odd :)

Anyways. Looks like the current defaultString could happily handle them by
weakening the parameter from a String to an Objeect. What do you think?

Hen

On Tue, 22 Oct 2002, Henri Yandell wrote:

>
> Went to look at em, and pine is not happy with the attachments at all.
> One it refuses to open [something illegal in the encoding] and the other
> is empty. So not sure what happened to me there.
>
> Could you summarise the methods inline?
>
> I assume:
>
> public String defaultString(Object o) {
>     return defaultString(o, "");
> }
>
> public String defaultString(Object o, String s) {
>     return (o == null)? s : o.toString();
> }
>
> ????
>
> As to where it lives. Am unsure. Is a Utils based on what goes in or what
> goes out.. Should this really go in a ConvertUtils [it'd get lost I
> think].
>
> I would think that the current StringUtils.defaultString(String,String)
> should simply be changed to be more generic. As we've released, moving it
> to ObjectUtils seems unneeded and bad, there's justification for it to go
> either way.
>
> Renaming defaultString to defaultIfNull, or defaultStringIfNull or
> changing ObjectUtils.defaultIfNull to defaultObject would be nice in
> hindsight, but I is it worth throwing deprecations around? Probably not :)
>
> Of course, I could be making assumptions on what's in the patch.
>
> Hen
>
> On Tue, 22 Oct 2002, Stephen Colebourne wrote:
>
> > I think these methods fit better with ObjectUtils. What d'ya think?
> >
> > Stephen
> >
> > From: "Henri Yandell" <bayard@generationjava.com>
> > > Will apply today at some point [writes it down on the whiteboard, where of
> > > course nothing ever gets deleted]
> > >
> > > Hen
> > >
> > > On Mon, 21 Oct 2002, Fredrik Westermarck wrote:
> > >
> > > > Hi!
> > > >
> > > > Here is a patch that adds the defaultString(Object) and
> > defaultString(Object,
> > > > String) to StringUtils. I've also attached a patch with the test cases
> > for the
> > > > new methods.
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <mailto:commons-dev-unsubscribe@jakarta.apache.org>
> > > For additional commands, e-mail:
> > <mailto:commons-dev-help@jakarta.apache.org>
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message