I really think we shall have a common template for Enums XenoAmess
________________________________ From: Gary Gregory <[email protected]> Sent: Monday, April 27, 2020 8:50:22 AM To: Commons Developers List <[email protected]> Subject: [configuration] org.apache.commons.configuration2.ImmutableConfiguration.getEnum()? Hi All: I'd like to have a way to get an enum instance out of a org.apache.commons.configuration2.ImmutableConfiguration. I'm surprised there is nothing like a getEnum(...). Any thoughts about adding: default <T extends Enum<T>> T getEnum(String key, Class<T> enumType) { return Enum.valueOf(enumType, getString(key)); } default <T extends Enum<T>> T getEnum(String key, Class<T> enumType, String defaultEnum) { return Enum.valueOf(enumType, getString(key, defaultEnum)); } ? Gary
