Here is the piece of code I have
MyValue sampleValue = Values.newHeapInstance(MyValue.class);
// subsequently set the couple of floats and int i have defined in MyValue interface
ChronicleMap<MyKey, MyValue> cache = ChronicleMapBuilder.of(MyKey.class, MyValue.class)
.entries(100)
.averageValue(sampleValue)
.create();
When I do this I get the error
java.lang.IllegalArgumentException: Using BytesMarshallable and an interface value type not supported at net.openhft.chronicle.map.ChronicleMapBuilder.averageValue(ChronicleMapBuilder.java:660)
Can someone help me understand if this usage pattern is in-correct?
If I change to creating MyValue by implementing a concrete class and then doing a new on that as follows it works:
MyValue sampleValue = new MyValueImpl();
// subsequently set the couple of floats and int i have defined in MyValue interface
ChronicleMap<MyKey, MyValue> cache = ChronicleMapBuilder.of(MyKey.class, MyValue.class)
.entries(100)
.averageValue(sampleValue)
.create();