On Thu, Oct 7, 2010 at 8:58 PM, Chris Hubick <[email protected]> wrote:
> On Thu, Oct 7, 2010 at 9:20 AM, Florent Guillaume <[email protected]> wrote:
>> I don't think I got comments on this earlier proposal I made:
>>
>> I don't like this part of the CmisObject API and find it hard to use:
>>   <T> T getPropertyValue(String id);
>>   <T> List<T> getPropertyMultivalue(String id);
>>
>> I propose to change it to:
>>   <T> T getPropertyValue(String id);
>>
>> Which would returns a single value for a single-valued property, and a
>> List for a multi-valued property. If the client knew which of the two
>> methods to call, then it knows if it expects a List or not so it
>> doesn't change expressivity.
>
> Forcing all code reading multi-valued properties to cast to List<T>?  -1.

There's no casting involved. That's the point of having a generic free
type variable <T> for the return value in the signature (<T> is a free
variable because there's no <T> in the class definition). The previous
definitions had the same kind of signature btw.

Florent

-- 
Florent Guillaume, Director of R&D, Nuxeo
Open Source, Java EE based, Enterprise Content Management (ECM)
http://www.nuxeo.com   http://www.nuxeo.org   +33 1 40 33 79 87

Reply via email to