directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <elecha...@apache.org>
Subject Re: A small hint when using Enum in the codec
Date Thu, 11 Nov 2010 13:02:17 GMT
Absolutely. It's just that when you add a value to the fields, then avoid
using the getOrdinal() method ;)

On Thu, Nov 11, 2010 at 12:08 PM, Felix Knecht <felixk@apache.org> wrote:

> Don't be as idiot as I was : use getValue instead of getOrdinal, which
>> is based on the field order. Also always declare a 'value' field, not an
>> 'ordinal' field, as it was done in many case...
>>
>
> Well, it depends always on the use case. Some time ago when I fixed
> DIRSHARED-64 (Transform IStates and inherited interfaces/implementing
> classes to enums) I finally realized, that it's not really necessary to have
> a custom value. Sometimes the use of the ordinal can make sense as well (
> http://svn.apache.org/viewvc?rev=1028638&view=rev).
>



-- 
Regards,
Cordialement,
Emmanuel L├ęcharny
www.iktek.com

Mime
View raw message