refactoring

pull/6041/head
Nikita Koksharov 7 months ago
parent 9787dd1a0e
commit 08bb9c42a5

@ -164,7 +164,8 @@ public class LocalCacheView<K, V> {
@Override @Override
public Map.Entry<K, V> next() { public Map.Entry<K, V> next() {
CacheValue e = iter.next(); CacheValue e = iter.next();
return new AbstractMap.SimpleEntry<K, V>((K) e.getKey(), (V) e.getValue()); V val = toValue(e);
return new AbstractMap.SimpleEntry<K, V>((K) e.getKey(), val);
} }
@Override @Override
@ -240,7 +241,11 @@ public class LocalCacheView<K, V> {
} }
} }
protected V toValue(CacheValue cv) {
return (V) cv.getValue();
}
public CacheKey toCacheKey(Object key) { public CacheKey toCacheKey(Object key) {
ByteBuf encoded = object.encodeMapKey(key); ByteBuf encoded = object.encodeMapKey(key);
try { try {

Loading…
Cancel
Save