update 优化 补全 @Override 注解
This commit is contained in:
parent
d60774a7b8
commit
e0a00cfe98
@ -44,6 +44,7 @@ public class CaffeineCacheDecorator implements Cache {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
@Override
|
||||||
public <T> T get(Object key, Class<T> type) {
|
public <T> T get(Object key, Class<T> type) {
|
||||||
Object o = CAFFEINE.get(getUniqueKey(key), k -> cache.get(key, type));
|
Object o = CAFFEINE.get(getUniqueKey(key), k -> cache.get(key, type));
|
||||||
return (T) o;
|
return (T) o;
|
||||||
@ -55,6 +56,7 @@ public class CaffeineCacheDecorator implements Cache {
|
|||||||
cache.put(key, value);
|
cache.put(key, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public ValueWrapper putIfAbsent(Object key, Object value) {
|
public ValueWrapper putIfAbsent(Object key, Object value) {
|
||||||
CAFFEINE.invalidate(getUniqueKey(key));
|
CAFFEINE.invalidate(getUniqueKey(key));
|
||||||
return cache.putIfAbsent(key, value);
|
return cache.putIfAbsent(key, value);
|
||||||
@ -65,6 +67,7 @@ public class CaffeineCacheDecorator implements Cache {
|
|||||||
evictIfPresent(key);
|
evictIfPresent(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean evictIfPresent(Object key) {
|
public boolean evictIfPresent(Object key) {
|
||||||
boolean b = cache.evictIfPresent(key);
|
boolean b = cache.evictIfPresent(key);
|
||||||
if (b) {
|
if (b) {
|
||||||
@ -78,6 +81,7 @@ public class CaffeineCacheDecorator implements Cache {
|
|||||||
cache.clear();
|
cache.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean invalidate() {
|
public boolean invalidate() {
|
||||||
return cache.invalidate();
|
return cache.invalidate();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user