
context.ContextStore Maven / Gradle / Ivy
package context;
import java.util.Collections;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
public class ContextStore {
private static final ThreadLocal> map = ThreadLocal.withInitial(ConcurrentHashMap::new);
public static synchronized void put (Object key, Object value) {
if (key != null && value != null) {map.get().put(key, value);}
}
public static synchronized Object remove (Object key) {
return key != null ? ((ConcurrentHashMap, ?>)map.get()).remove(key) : null;
}
public static synchronized Object get (Object key) {
return key != null ? ((ConcurrentHashMap, ?>)map.get()).get(key) : null;
}
public static synchronized Set
© 2015 - 2025 Weber Informatics LLC | Privacy Policy