Here you can find the source of mergeMap(Map primaryValues, Map defaultValues)
Parameter | Description |
---|---|
primaryValues | The Properties containing primary values. |
defaultValues | The Properties containing default values. |
public static Properties mergeMap(Map primaryValues, Map defaultValues)
//package com.java2s; import java.util.*; public class Main { /**/* ww w. j a va2s . c om*/ * Create a list of Properties containing all keys from two lists of given Propertiess. * For keys existing in both lists, * the values in the first list overwrites the second list. * * @param primaryValues The Properties containing primary values. * @param defaultValues The Properties containing default values. * * @return List of properties. * */ public static Properties mergeMap(Map primaryValues, Map defaultValues) { Properties result = new Properties(); // Copy all default values if (defaultValues != null) { result.putAll(defaultValues); } // Overwrite it with the primary values. if (primaryValues != null) { result.putAll(primaryValues); } return result; } }