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

fatjar.Cache Maven / Gradle / Ivy

There is a newer version: 1.3.0
Show newest version
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 keys);

    boolean containsKey(K key);

    void put(K key, V value);

    void putAll(java.util.Map map);

    V putIfAbsent(K key, V value);

    V remove(K key);

    boolean replace(K key, V oldValue, V newValue);

    void removeAll(Set keys);

    void clear();


    enum Type {
        Map, Memcache, Redis
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy