commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vladimir Dzhuvinov <vladi...@dzhuvinov.com>
Subject [configuration] Adding method Configuration.getEnum() ?
Date Wed, 29 Sep 2010 05:22:50 GMT
Hello,

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

public <T extends Enum<T>> T getEnum(String key, Class<T> enumClass)
public <T extends Enum<T>> T getOptEnum(String key, Class<T>
enumClass, T default)

I've got couple of applications where configuration properties are
enums that map to Java enum classes. Having a direct method of
retrieving these enum values would be great for me.

The only downside to this proposal is that it requires a feature from
Java 1.5 whereas Commons Configuration seems to strive for Java 1.4
compatibility. Is this so?


Greetings,


Vladimir

-- 
Vladimir Dzhuvinov :: software.dzhuvinov.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message