Example usage for org.apache.commons.collections4.map CompositeMap CompositeMap

List of usage examples for org.apache.commons.collections4.map CompositeMap CompositeMap

Introduction

In this page you can find the example usage for org.apache.commons.collections4.map CompositeMap CompositeMap.

Prototype

@SuppressWarnings("unchecked")
public CompositeMap(final Map<K, V> one, final Map<K, V> two, final MapMutator<K, V> mutator) 

Source Link

Document

Create a new CompositeMap with two composited Map instances.

Usage

From source file:org.apache.hyracks.control.common.config.ConfigManager.java

private void applyDefaults() {
    LOGGER.fine("applying defaults");
    for (Map.Entry<Section, Map<String, IOption>> entry : sectionMap.entrySet()) {
        if (entry.getKey() == Section.NC) {
            entry.getValue().values().forEach(option -> getNodeNames()
                    .forEach(node -> getOrDefault(getNodeEffectiveMap(node), option, node)));
            for (Map.Entry<String, Map<IOption, Object>> nodeMap : nodeSpecificMap.entrySet()) {
                entry.getValue().values()
                        .forEach(option -> getOrDefault(
                                new CompositeMap<>(nodeMap.getValue(), definedMap, new NoOpMapMutator()),
                                option, nodeMap.getKey()));
            }/*from   w w  w  . j  ava  2  s .co  m*/
        } else {
            entry.getValue().values().forEach(option -> getOrDefault(configurationMap, option, null));
        }
    }
}

From source file:org.apache.hyracks.control.common.config.ConfigManager.java

private CompositeMap<IOption, Object> getNodeEffectiveMap(String nodeId) {
    return new CompositeMap<>(nodeSpecificMap.get(nodeId), definedMap, new NoOpMapMutator());
}