Add ChronicleMap.readKey() and readValue() for convenient work with BytesMapEventListener

This commit is contained in:
leventov
2015-07-28 08:15:12 +03:00
parent c1a630f129
commit 7e9daf73f3
6 changed files with 66 additions and 0 deletions
@@ -16,6 +16,7 @@
package net.openhft.chronicle.map;
import net.openhft.lang.io.Bytes;
import org.jetbrains.annotations.NotNull;
import org.junit.Assert;
@@ -245,6 +246,16 @@ public class ReplicationCheckingMap<K, V> implements ChronicleMap<K, V> {
throw new UnsupportedOperationException();
}
@Override
public K readKey(Bytes entry, long keyPos) {
return map1.readKey(entry, keyPos);
}
@Override
public V readValue(Bytes entry, long valuePos) {
return map1.readValue(entry, valuePos);
}
@Override
public Class<K> keyClass() {
return map1.keyClass();
@@ -19,6 +19,7 @@ package net.openhft.chronicle.map.jsr166.map;
import net.openhft.chronicle.hash.replication.TcpTransportAndNetworkConfig;
import net.openhft.chronicle.map.*;
import net.openhft.chronicle.map.jsr166.JSR166TestCase;
import net.openhft.lang.io.Bytes;
import org.jetbrains.annotations.NotNull;
import org.junit.After;
import org.junit.Before;
@@ -198,6 +199,16 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
throw new UnsupportedOperationException();
}
@Override
public K readKey(Bytes entry, long keyPos) {
return d.readKey(entry, keyPos);
}
@Override
public V readValue(Bytes entry, long valuePos) {
return d.readValue(entry, valuePos);
}
@Override
public Class<K> keyClass() {
return d.keyClass();