HCOLL-136 added keyMarshallers(), keySizeMarshaller() and valueSizeMarshaller() methods to Builder interfaces; removed factory field from SerializationBuilder and VanillaChronicleMap as unused

This commit is contained in:
leventov
2014-11-07 16:15:37 +03:00
parent 09008f16fe
commit 49172e4b3b
7 changed files with 165 additions and 56 deletions
@@ -22,6 +22,9 @@ import net.openhft.chronicle.hash.*;
import net.openhft.chronicle.hash.replication.SimpleReplication;
import net.openhft.chronicle.hash.replication.TcpConfig;
import net.openhft.chronicle.hash.replication.TimeProvider;
import net.openhft.chronicle.hash.serialization.BytesReader;
import net.openhft.chronicle.hash.serialization.BytesWriter;
import net.openhft.chronicle.hash.serialization.SizeMarshaller;
import net.openhft.chronicle.map.ChronicleMap;
import net.openhft.chronicle.map.ChronicleMapBuilder;
import net.openhft.lang.io.serialization.BytesMarshaller;
@@ -53,7 +56,8 @@ public class ChronicleSetBuilder<E>
ChronicleSetBuilder(Class<E> keyClass) {
chronicleMapBuilder = ChronicleMapBuilder.of(keyClass, DummyValue.class)
.valueMarshallers(DummyValueMarshaller.INSTANCE, DummyValueMarshaller.INSTANCE);
.valueMarshallers(DummyValueMarshaller.INSTANCE, DummyValueMarshaller.INSTANCE)
.valueSizeMarshaller(DummyValueMarshaller.INSTANCE);
}
public static <K> ChronicleSetBuilder<K> of(Class<K> keyClass) {
@@ -225,6 +229,19 @@ public class ChronicleSetBuilder<E>
return this;
}
@Override
public ChronicleSetBuilder<E> keyMarshallers(@NotNull BytesWriter<E> keyWriter,
@NotNull BytesReader<E> keyReader) {
chronicleMapBuilder.keyMarshallers(keyWriter, keyReader);
return this;
}
@Override
public ChronicleSetBuilder<E> keySizeMarshaller(@NotNull SizeMarshaller keySizeMarshaller) {
chronicleMapBuilder.keySizeMarshaller(keySizeMarshaller);
return this;
}
/**
* {@inheritDoc}
*