View Javadoc
1   package org.kuali.common.util.cache;
2   
3   import java.util.Collections;
4   import java.util.HashMap;
5   import java.util.Map;
6   
7   public final class SimpleCache<K, V> implements Cache<K, V> {
8   
9   	private final Map<K, V> map = Collections.synchronizedMap(new HashMap<K, V>());
10  
11  	@Override
12  	public void put(K key, V value) {
13  		map.put(key, value);
14  	}
15  
16  	@Override
17  	public V get(K key) {
18  		return map.get(key);
19  	}
20  
21  	@Override
22  	public void clear() {
23  		map.clear();
24  	}
25  
26  }