public ConfigParams getSection ( String section ) { ConfigParams result = new ConfigParams ( ) ; String prefix = section + "." ; for ( Map . Entry < String , String > entry : this . entrySet ( ) ) { String key = entry . getKey ( ) ; // Prevents exception on the next line if ( key . length ( ) < prefix . length ( ) ) continue ; // Perform case sensitive match String keyPrefix = key . substring ( 0 , prefix . length ( ) ) ; if ( keyPrefix . equalsIgnoreCase ( prefix ) ) { key = key . substring ( prefix . length ( ) ) ; result . put ( key , entry . getValue ( ) ) ; } } return result ; }
Gets parameters from specific section stored in this ConfigMap . The section name is removed from parameter keys .