/******************************************************************************* *******************************************************************************/ package at.gv.egiz.eaaf.core.impl.idp.process.spring.test; import java.io.Serializable; import java.util.Collections; import java.util.HashMap; import java.util.Map; import at.gv.egiz.eaaf.core.api.idp.process.ExpressionEvaluationContext; /** * Adapter class for {@link ExpressionEvaluationContext}. Intended to be used for testing purposes. * * @author tknall * */ public class ExpressionContextAdapter implements ExpressionEvaluationContext { private static final long serialVersionUID = 1L; private Map ctxData = Collections.synchronizedMap(new HashMap()); /** * Returns a certain {@link Serializable} object associated with a certain {@code key}. * * @param key * The key. * @return The object or {@code null} if no object was found stored with that key or if a {@code null} value was * stored. */ Serializable get(String key) { return ctxData.get(key); } /** * Stores a {@link Serializable} with a certain {@code key}. * * @param key * The key. * @param object * The object. */ void put(String key, Serializable object) { ctxData.put(key, object); } @Override public Map getCtx() { return Collections.unmodifiableMap(ctxData); } }