net.n2oapp.framework.api.test.TestContextEngine Maven / Gradle / Ivy
package net.n2oapp.framework.api.test;
import net.n2oapp.framework.api.context.ContextEngine;
import java.util.HashMap;
import java.util.Map;
/**
* @author iryabov
* @since 27.10.2016
*/
public class TestContextEngine extends HashMap implements ContextEngine {
public TestContextEngine() {
super();
}
public TestContextEngine(Map baseParams) {
super(baseParams);
}
@Override
public Object get(String param, Map baseParams) {
Object value = baseParams.get(param);
return value != null ? value : get(param);
}
@Override
public void set(Map dataSet, Map baseParams) {
putAll(dataSet);
putAll(baseParams);
}
@Override
public Object get(String name) {
return super.get(name);
}
@Override
public void set(Map dataSet) {
putAll(dataSet);
}
}