Java Map Merge mergeConfig(Map userConfig, Map referenceConfig)

Here you can find the source of mergeConfig(Map userConfig, Map referenceConfig)

Description

Produce a map where the reference values are overridden with user values.

License

Open Source License

Parameter

Parameter Description
userConfig User configuration values.
referenceConfig Reference configuration values.

Return

A merge of user and reference configuration.

Declaration

private static Map<String, Object> mergeConfig(Map<String, Object> userConfig,
        Map<String, Object> referenceConfig) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.HashMap;
import java.util.Map;

public class Main {
    /**/*from  www . j a  v a 2s  .c  o m*/
     * Produce a map where the reference values are overridden with user values.
     *
     * @param userConfig      User configuration values.
     * @param referenceConfig Reference configuration values.
     * @return A merge of user and reference configuration.
     */
    private static Map<String, Object> mergeConfig(Map<String, Object> userConfig,
            Map<String, Object> referenceConfig) {
        Map<String, Object> config = new HashMap<>(referenceConfig);
        config.putAll(userConfig);
        return config;
    }
}

Related

  1. merge(Map mapPriorityLeast, Map mapPriorityFirst)
  2. mergeAggCompStatsTopoPageSpout(Map accSpoutStats, Map spoutStats)
  3. mergeBootArgumentsIntoMap(String[] args, Map map)
  4. mergeCompactedValue(Map obj, String key, Object value)
  5. mergeCompositions( Map target, Map source)
  6. mergeCounterMap(Map map, String key, Object value)
  7. mergeCountMaps(Map base, Map other)
  8. mergeCounts(Map counter, String key)
  9. mergeCustomProperties(Map copyTo, Map copyFrom)