fatjar.Cache Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of FatJar Show documentation
Show all versions of FatJar Show documentation
FatJar simple API to quick prototyping and portable web services
package fatjar;
import fatjar.implementations.cache.CurrentCache;
import java.util.Map;
import java.util.Set;
public interface Cache {
@SuppressWarnings("unchecked")
static Cache create(String name) {
return (Cache) CurrentCache.create(name);
}
@SuppressWarnings("unchecked")
static Cache create(Type type, String name) {
return (Cache) CurrentCache.create(type, name);
}
Cache.Type getType();
String getName();
V get(K key);
Map getAll();
Map getAll(Set extends K> keys);
boolean containsKey(K key);
void put(K key, V value);
void putAll(java.util.Map extends K, ? extends V> map);
V putIfAbsent(K key, V value);
V remove(K key);
boolean replace(K key, V oldValue, V newValue);
void removeAll(Set extends K> keys);
void clear();
enum Type {
Map, Memcache, Redis
}
}