commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Bourg <>
Subject Re: [configuration] Adding method Configuration.getEnum() ?
Date Wed, 13 Oct 2010 10:18:28 GMT
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

View raw message