Thanks Peter. Berin has already suggested this to me but I didn't like
too much as it was an indirect way of testing for existence, like using
Hashtable.get("key") == null instead of Hashtable.containsKey("key")
which better captures the intent. However, that will do for the time
being ... :-)

Cheers,
-Vincent

> -----Original Message-----
> From: Peter Royal [mailto:[EMAIL PROTECTED]
> Sent: 12 December 2001 20:48
> To: Avalon Developers List
> Subject: Re: new method Configuration.containsAttribute() ?
> 
> On Wednesday 12 December 2001 03:37 pm, you wrote:
> > I can imagine lots of cases where you would need to verify if an
> > attribute exists because you may want to do something different if
it
> > does than if it does not.
> 
> String value = configuration.getAttribute("attr", null);
> 
> if (value == null) {
>       //there was no attribute
> } else if ("".equals(value)) {
>       //exists but empty
> } else {
>       //exists and non-empty
> }
> 
> -pete
> 
> --
> peter royal -> [EMAIL PROTECTED]
> 
> --
> To unsubscribe, e-mail:   <mailto:avalon-dev-
> [EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:avalon-dev-
> [EMAIL PROTECTED]>
> 




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to