Copies the parsed command line options to the {@link Config} class
@param config Configuration instance to override
@since 2.0
428361
static void overloadConfig(final ArgP argp, final Config config) {

    // loop and switch so we can map cli options to tsdb options
    for (Map.Entry<String, String> entry : argp.getParsed().entrySet()) {
      // map the overrides
      if (entry.getKey().toLowerCase().equals("--auto-metric")) {
        config.overrideConfig("tsd.core.auto_create_metrics", "true");
      } else if (entry.getKey().toLowerCase().equals("--disable-ui")) {
        config.overrideConfig("tsd.core.enable_ui", "false");
      } else if (entry.getKey().toLowerCase().equals("--disable-api")) {
        config.overrideConfig("tsd.core.enable_api", "false");
      } else if (entry.getKey().toLowerCase().equals("--table")) {
        config.overrideConfig("tsd.storage.hbase.data_table", entry.getValue());
      } else if (entry.getKey().toLowerCase().equals("--uidtable")) {
        config.overrideConfig("tsd.storage.hbase.uid_table", entry.getValue());
      } else if (entry.getKey().toLowerCase().equals("--zkquorum")) {
        config.overrideConfig("tsd.storage.hbase.zk_quorum",
            entry.getValue());
      } else if (entry.getKey().toLowerCase().equals("--zkbasedir")) {
        config.overrideConfig("tsd.storage.hbase.zk_basedir",
            entry.getValue());
      } else if (entry.getKey().toLowerCase().equals("--port")) {
        config.overrideConfig("tsd.network.port", entry.getValue());
      } else if (entry.getKey().toLowerCase().equals("--staticroot")) {
        config.overrideConfig("tsd.http.staticroot", entry.getValue());
      } else if (entry.getKey().toLowerCase().equals("--cachedir")) {
        config.overrideConfig("tsd.http.cachedir", entry.getValue());
      } else if (entry.getKey().toLowerCase().equals("--flush-interval")) {
        config.overrideConfig("tsd.core.flushinterval", entry.getValue());
      } else if (entry.getKey().toLowerCase().equals("--backlog")) {
        config.overrideConfig("tsd.network.backlog", entry.getValue());
      } else if (entry.getKey().toLowerCase().equals("--read-only")) {
        config.overrideConfig("tsd.mode", "ro");
      } else if (entry.getKey().toLowerCase().equals("--bind")) {
        config.overrideConfig("tsd.network.bind", entry.getValue());
      } else if (entry.getKey().toLowerCase().equals("--async-io")) {
        config.overrideConfig("tsd.network.async_io", entry.getValue());
      } else if (entry.getKey().toLowerCase().equals("--worker-threads")) {
        config.overrideConfig("tsd.network.worker_threads", entry.getValue());
      } else if(entry.getKey().toLowerCase().equals("--use-otsdb-ts")) {
        config.overrideConfig("tsd.storage.use_otsdb_timestamp", "true");
      } else if (entry.getKey().toLowerCase().equals("--dtc-ts")) {
        config.overrideConfig("tsd.storage.get_date_tiered_compaction_start", entry.getValue());
      }
    }
  }
1067897
public function setConfig(Config $config)
    {
        $this->checkConfigConsistency($config);

        $this->config = $config;

        return $this;
    }
436538
@Modified
    protected void modified(Map<String, Object> config) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
            Tr.event(tc, "Config modified: " + this);
        }

        if (null == config) {
            return;
        }
        final String ENC = "encoding.";
        final String CONV = "converter.";
        for (Map.Entry<String, Object> entry : config.entrySet()) {
            String key = entry.getKey();
            int len = key.length();
            try {
                if (len > ENC.length() && key.startsWith(ENC)) {
                    String value = (String) entry.getValue();
                    localeMap.put(key.substring(ENC.length()), value);
                } else if (len > CONV.length() && key.startsWith(CONV)) {
                    String value = (String) entry.getValue();
                    converterMap.put(key.substring(CONV.length()).toLowerCase(),
                                     value.toLowerCase());
                }
            } catch (Throwable t) {
                FFDCFilter.processException(t,
                                            "EncodingUtils.processConfig", "1",
                                            new Object[] { key, entry.getValue() });
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                    Tr.event(tc, "Invalid property: [" + key
                                 + "]=[" + config.get(key) + "]");
                }
            }
        } // loop on the entries
    }
1001720
public function configure( Config $config )
    {
        parent::configure($config);

        $this->_field_order    = $this->processMacro($config->getList('field_order', []));
        $this->_delimiter      = $this->processMacro($config->getInteger('delimiter', 0));
        $this->_double_quoted  = $this->processMacro($config->getBoolean('double_quoted', false));
        $this->_eol_code       = $this->processMacro($config->getInteger('eol_code', 0));
    }
937300
private void overrideConfigFromFile(Configuration config) throws IOException {
    String configFile = GCS_CONFIG_OVERRIDE_FILE.get(config, config::get);
    if (configFile != null) {
      config.addResource(new FileInputStream(configFile));
    }
  }
1192974
public function setConfig($config)
	{
		if (is_object($config)) {
			$config = get_object_vars($config);
		}
		foreach ($config as $index => $value) {
			$this->$index = $value;
		}
	}
949646
@Override
	public void applyConfig(final ConfigSettings config)
	{

		Object o = config
				.getConfigParameter(ConfigurationKeys.LOGGING_PATH_DIFFTOOL);
		if (o != null) {
			this.diffToolField.setText((String) o);
		}
		else {
			this.diffToolField.setText("");
		}

		o = config
				.getConfigParameter(ConfigurationKeys.LOGGING_LOGLEVEL_DIFFTOOL);
		if (o != null) {
			this.diffToolLogLevelComboBox.setSelectedItem(o);
		}

	}
87048
private static Configuration createCfg(TemplateConfig config) {
		if (null == config) {
			config = new TemplateConfig();
		}

		final Configuration cfg = new Configuration(Configuration.VERSION_2_3_28);
		cfg.setLocalizedLookup(false);
		cfg.setDefaultEncoding(config.getCharset().toString());

		switch (config.getResourceMode()) {
		case CLASSPATH:
			cfg.setTemplateLoader(new ClassTemplateLoader(ClassUtil.getClassLoader(), config.getPath()));
			break;
		case FILE:
			try {
				cfg.setTemplateLoader(new FileTemplateLoader(FileUtil.file(config.getPath())));
			} catch (IOException e) {
				throw new IORuntimeException(e);
			}
			break;
		case WEB_ROOT:
			 try {
				 cfg.setTemplateLoader(new FileTemplateLoader(FileUtil.file(FileUtil.getWebRoot(), config.getPath())));
			 } catch (IOException e) {
				 throw new IORuntimeException(e);
			 }
			break;
		case STRING:
			cfg.setTemplateLoader(new SimpleStringTemplateLoader());
			break;
		default:
			break;
		}
		
		return cfg;
	}
1062942
protected function _setConfig($config)
    {
        if (strlen($config['url']) > 1 && $config['url'][0] === '/') {
            $config['url'] = substr($config['url'], 1);
        }

        if (empty($config['session'])) {
            $config['session'] = new Session([
                'cookiePath' => $config['base']
            ]);
        }

        $this->_environment = $config['environment'];
        $this->cookies = $config['cookies'];

        if (isset($config['uri']) && $config['uri'] instanceof UriInterface) {
            $uri = $config['uri'];
        } else {
            $uri = ServerRequestFactory::createUri($config['environment']);
        }

        // Extract a query string from config[url] if present.
        // This is required for backwards compatibility and keeping
        // UriInterface implementations happy.
        $querystr = '';
        if (strpos($config['url'], '?') !== false) {
            list($config['url'], $querystr) = explode('?', $config['url']);
        }
        if (strlen($config['url'])) {
            $uri = $uri->withPath('/' . $config['url']);
        }
        if (strlen($querystr)) {
            $uri = $uri->withQuery($querystr);
        }

        $this->uri = $uri;
        $this->base = $config['base'];
        $this->webroot = $config['webroot'];

        $this->url = substr($uri->getPath(), 1);
        $this->here = $this->base . '/' . $this->url;

        if (isset($config['input'])) {
            $stream = new Stream('php://memory', 'rw');
            $stream->write($config['input']);
            $stream->rewind();
        } else {
            $stream = new PhpInputStream();
        }
        $this->stream = $stream;

        $config['post'] = $this->_processPost($config['post']);
        $this->data = $this->_processFiles($config['post'], $config['files']);
        $this->query = $this->_processGet($config['query'], $querystr);
        $this->params = $config['params'];
        $this->session = $config['session'];
    }
169566
private void parseConfig(String config) {

        if (isValidConfig(config)) {
            String[] conf = config.split("x");
            if (conf[0].trim().equals("?")) {
                m_width = I_CmsFormatRestriction.DIMENSION_NOT_SET;
            } else {
                m_width = CmsClientStringUtil.parseInt(conf[0]);
                m_width = (m_width == 0) ? I_CmsFormatRestriction.DIMENSION_NOT_SET : m_width;
            }
            if (conf[1].trim().equals("?")) {
                m_height = I_CmsFormatRestriction.DIMENSION_NOT_SET;
            } else {
                m_height = CmsClientStringUtil.parseInt(conf[1]);
                m_height = (m_height == 0) ? I_CmsFormatRestriction.DIMENSION_NOT_SET : m_height;
            }
        }
    }
1211833
@Inject
	public void setTimeFromConfigIfSet(GuiceConfig config)
	{
		final String str = config.get("daemon." + getName() + ".time", null);

		if (StringUtils.isNotEmpty(str))
		{
			this._time = LocalTime.parse(str);
		}
	}
8663
private void parseConfiguration(String config) {

        CmsSelectConfigurationParser parser = new CmsSelectConfigurationParser(config);
        m_comboBox = new CmsSelectComboBox(parser.getOptions(), false);
        if (parser.getDefaultValue() != null) {
            //set the declared value selected.
            m_comboBox.setFormValueAsString(parser.getDefaultValue());
        }
        fireChangeEvent();
    }
438932
public static final StreamConfiguration encode(final StreamConfig config) {
        Preconditions.checkNotNull(config, "config");
        return StreamConfiguration.builder()
                .scalingPolicy(encode(config.getScalingPolicy()))
                .retentionPolicy(encode(config.getRetentionPolicy()))
                .build();
    }
550089
public void configure(ConfigParams config) throws ConfigException {
		_timeout = config.getAsLongWithDefault("timeout", _timeout);
		_maxSize = config.getAsLongWithDefault("max_size", _maxSize);
	}
149412
public function setConfig(Config $config)
    {
        parent::setConfig($config);

        $this->command->setConfig($config);

        return $this;
    }
1262238
public void setConfigFile(final String config) {
        if (config == null) {
            throw (new IllegalArgumentException(
                    "Configuration file parameter is null"));
        }
        File file = new File(config);
        if (file.exists()) {
            if (file.isDirectory()) {
                throw new IllegalArgumentException("Folder " + config
                        + " is not a configuration file");
            }
        } else {
            throw new IllegalArgumentException("Configuration file " + config
                    + " not found");
        }
        setConfigFile(file);
    }
879665
@Override
	public void configure(ConfigParams config) {
		_name = config.getAsStringWithDefault("name", _name);
		_name = config.getAsStringWithDefault("info.name", _name);

		_description = config.getAsStringWithDefault("description", _description);
		_description = config.getAsStringWithDefault("info.description", _description);

		_properties = config.getSection("properties");

	}