Example usage for org.apache.commons.collections.keyvalue MultiKey getKey

List of usage examples for org.apache.commons.collections.keyvalue MultiKey getKey

Introduction

In this page you can find the example usage for org.apache.commons.collections.keyvalue MultiKey getKey.

Prototype

public Object getKey(int index) 

Source Link

Document

Gets the key at the specified index.

Usage

From source file:pl.touk.ode.scopeEvaluator.MockExtVarManager.java

@SuppressWarnings("unchecked")
public ValueReferencePair writeExternalVariable(String name, Node key, Node value) {
    Element soFar = extVars.remove(elementToKey(name, convertToElement(key)));
    Map<String, String> vals = new HashMap<String, String>();
    vals.putAll((Map<String, String>) elementToKey(name, convertToElement(key)).getKey(1));
    if (soFar != null) {
        vals.putAll(elementToMap(soFar));
    }//from w  w  w. j  ava2s  .  c o  m
    vals.putAll(elementToMap(convertToElement(value)));
    Element newEl = mapToElement(name, vals, false);

    MultiKey mk = elementToKey(name, newEl);
    extVars.put(mk, newEl);
    ValueReferencePair ret = new ValueReferencePair();
    ret.value = newEl;
    ret.reference = mapToElement(name, (Map<String, String>) mk.getKey(1), true);
    return ret;
}