public static Enum < ? > findMatchingEnumVal ( Field field , String unknownEnumName ) { if ( unknownEnumName == null || unknownEnumName . length ( ) == 0 ) { return null ; } for ( Enum < ? > enumVal : ( Enum < ? > [ ] ) field . getType ( ) . getEnumConstants ( ) ) { if ( enumVal . name ( ) . equals ( unknownEnumName ) ) { return enumVal ; } } throw new IllegalArgumentException ( "Unknwown enum unknown name " + unknownEnumName + " for field " + field ) ; }
Internal method that finds the matching enum for a configured field that has the name argument .