public static Config overlayOn(Map<String,?> overlay, Config underlying) {
    StringBuilder configFileString = new StringBuilder();
    overlay.forEach((k, v) -> configFileString.append(k).append('=').append(v).append('\n'));
    String configFile = configFileString.toString();
    log.debug("Overlaid config: \n{}", configFile);
    return ConfigFactory.parseString(configFile).resolve().withFallback(underlying);
  }
public static Config overlayOn ( Map < String , ? > overlay , Config underlying ) { StringBuilder configFileString = new StringBuilder ( ) ; overlay . forEach ( ( k , v ) -> configFileString . append ( k ) . append ( '=' ) . append ( v ) . append ( '\n' ) ) ; String configFile = configFileString . toString ( ) ; log . debug ( "Overlaid config: \n{}" , configFile ) ; return ConfigFactory . parseString ( configFile ) . resolve ( ) . withFallback ( underlying ) ; }
@param overlay map of key-value pairs to add to default config. The map is converted
to a string representation, as it were from a config file, and parsed accordingly.
@param underlying underlying config to overlay new settings on top of
@return default config but with key-value pairs added