>>This risk could be mitigated by returning a prefix (for example the
class name) and the value (except for binaries of course):

Yes, I agree. I tend to do things like

ItemImpl[Name=Foo;Type=Boohoo]

as a toString format.

So long as this is ok, i'll add them.


-----Original Message-----
From: Thomas Mueller <[EMAIL PROTECTED]>
Sent: Monday, April 14, 2008 4:37am
To: [email protected]
Subject: Re: lack of toString?

Hi,

>  I think the risk Dave was mentioning was that if, for instance, toString()
> returns the same thing as getString() (on Value), then people - by mistake -
> my call the incorrect method, thus making code non-portable.

This risk could be mitigated by returning a prefix (for example the
class name) and the value (except for binaries of course):

public String toString() {
    return getClass().getName() + ":" + lNumber;
}

Regards,
Thomas


Reply via email to