Java Utililty Methods Map Merge

List of utility methods to do Map Merge

Description

The list of methods to do Map Merge are organized into topic(s).

Method

voidmergeValue(Map obj, String key, Object value)
merge Value
if (obj == null) {
    return;
List<Object> values = (List<Object>) obj.get(key);
if (values == null) {
    values = new ArrayList<Object>();
    obj.put(key, values);
if ("@list".equals(key) || (value instanceof Map && ((Map<String, Object>) value).containsKey("@list"))
        || !deepContains(values, value)) {
    values.add(value);
voidmergeValueInMap(Map map, String name, String value)
merge Value In Map
String[] newValues;
String[] oldValues = map.get(name);
if (oldValues == null) {
    newValues = new String[1];
    newValues[0] = value;
} else {
    newValues = new String[oldValues.length + 1];
    System.arraycopy(oldValues, 0, newValues, 0, oldValues.length);
...