From 120454fce9f6b006404bfd609e3b829abfef481b Mon Sep 17 00:00:00 2001 From: Rob Austin Date: Wed, 15 Oct 2014 13:15:39 +0100 Subject: [PATCH] added Key Value Object Types --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index 4f30fa7ca..154edc2b4 100644 --- a/README.md +++ b/README.md @@ -168,6 +168,29 @@ and define the snapshot version in your pom.xml, for example: 1.0.1-SNAPSHOT ``` + +#### Key Value Object Types + +Unlike HashMap which will support any heap object, Chronicle Map only works with objects that it +can store off heap, so the objects have to be : (one of the following ) + +- AutoBoxed primitives - for good performance. +- Strings - for good performance. +- implements Serializable +- implements Externalizable ( with a public default constructor ) +- Implements our custom interface BytesMarshallable ( with a public default constructor ) - use this for best performance. + +or value objects that are created through, a directClass interface, for example : +``` java + ChronicleMap chm = ChronicleMapBuilder + .of(String.class, directClassFor(BondVOInterface.class)) + .create(file); + +``` + +Object graphs can also be included as long as the outer object supports Serializable, Externalizable or BytesMarshallable. + + #### Java Class Construction Creating an instance of Chronicle Map is a little more complexed than just calling a constructor.