commons-user mailing list archives

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

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?



Vladimir Dzhuvinov ::

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message