You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Emmanuel Bourg <eb...@apache.org> on 2010/10/13 12:18:28 UTC

Re: [configuration] Adding method Configuration.getEnum() ?

Le 29/09/2010 07:22, Vladimir Dzhuvinov a écrit :

> Would it make sense to add a new method for retrieving enum values in
> some future version of Configuration?

Hi Vladimir,

Enums are already supported through the DataConfiguration class. You 
just have to wrap your configuration into a DataConfiguration and call 
config.get(MyEnum.class, "key"). This will return the enum constant from 
its name or its ordinal.

Emmanuel Bourg