private static void setCollectionParam ( String name , List < ? > values ) throws ConfigurationException { try { Field field = config . getClass ( ) . getDeclaredField ( name ) ; Class < ? > fieldClass = field . getType ( ) ; if ( Map . class . isAssignableFrom ( fieldClass ) ) { setMapParam ( field , values ) ; } else if ( List . class . isAssignableFrom ( fieldClass ) ) { setListParam ( field , values ) ; } else { throw new ConfigurationException ( "Invalid value type for parameter: " + name ) ; } } catch ( SecurityException | NoSuchFieldException e ) { throw new ConfigurationException ( "Unknown configuration parameter: " + name ) ; } }
Set a configuration parameter with a Collection type .