directory-api mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Swift <Matthew.Sw...@Sun.COM>
Subject Re: About the Control interface
Date Mon, 25 Jan 2010 13:54:49 GMT


On 25/01/10 13:56, Emmanuel Lecharny wrote:
> Matthew Swift a écrit :
>> <snip/>
>>    GenericControl(String oid) // non-critical, null value
>>    GenericControl(String oid, boolean isCritical) // null value
> Makes sense to add this constructor, but for Control with *no* value 
> (semantically more accurate, compared to *null* value).
>>    GenericControl(String oid, boolean isCritical, ByteString bytes)
> byte[] fits well, I think.
>> <snip/>
>
>> The Control API must distinguish between null values (i.e. value not 
>> present) and empty values (i.e. value present but zero-length).
> Absolutely. I mis-judged this need, so we should add this method :
>
> boolean hasValue();

This is not strictly necessary. If getValue() returns null then you know 
there was no value. If getValue().length == 0 then you know that there 
was a value but it was empty. Having said that, hasValue is definitely 
more readable.

Matt


Mime
View raw message