All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.talk2object.common.ContextImpl Maven / Gradle / Ivy

The newest version!
package com.talk2object.common;

import java.util.HashMap;
import java.util.Map;

public class ContextImpl implements Context {
	private Context parentContext;

	private Map map = new HashMap();

	public ContextImpl(Context parentContext) {
		this.parentContext = parentContext;
	}

	@Override
	public Object get(String key) {

		Object obj = map.get(key);
		if (obj == null) {
			if (parentContext != null)
				obj = parentContext.get(key);
		}

		return obj;
	}

	@Override
	public void set(String key, Object value) {
		map.put(key, value);

	}

	@Override
	public void remove(String key) {
		map.remove(key);

	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy