com.github.nmuzhichin.jsonrpc.cache.GuavaCache Maven / Gradle / Ivy
package com.github.nmuzhichin.jsonrpc.cache;
import com.google.common.cache.Cache;
/**
* The adapter for the guava cache provider.
*/
public class GuavaCache implements CacheProvider {
private final Cache cache;
public GuavaCache(final Cache cache) {
this.cache = cache;
}
@Override
public Object get(final String key) {
return cache.getIfPresent(key);
}
@Override
public void put(final String key, final Object value) {
cache.put(key, value);
}
}