Skip to content

Commit

Permalink
Feature - implementation of Spring Cache methods added in Spring 5.2 #…
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita Koksharov committed Dec 14, 2022
1 parent f0b722c commit 2554dea
Showing 1 changed file with 9 additions and 0 deletions.
Expand Up @@ -146,15 +146,24 @@ public ValueWrapper putIfAbsent(Object key, Object value) {

@Override
public void evict(Object key) {
evictIfPresent(key);
}

public boolean evictIfPresent(Object key) {
long delta = map.fastRemove(key);
addCacheEvictions(delta);
return delta > 0;
}

@Override
public void clear() {
map.clear();
}

public boolean invalidate() {
return map.delete();
}

private ValueWrapper toValueWrapper(Object value) {
if (value == null) {
return null;
Expand Down

0 comments on commit 2554dea

Please sign in to comment.