Use a ValueSerializer to serialize values state.
Serialized object must be one of:
- a ValueComposite,
- an EntityComposite or EntityReference,
- an Iterable,
- a Map,
- a Plain Value.
Nested plain values, EntityReferences, Iterables, Maps, ValueComposites and EntityComposites are supported.
EntityComposites and EntityReferences are serialized as their identity string.
Plain values can be one of:
- String,
- Character or char,
- Boolean or boolean,
- Integer or int,
- Long or long,
- Short or short,
- Byte or byte,
- Float or float,
- Double or double,
- BigInteger,
- BigDecimal,
- Date,
- DateTime (JodaTime),
- LocalDateTime (JodaTime),
- LocalDate (JodaTime).
Values of unknown types and all arrays are considered as
java.io.Serializable and by so are serialized to
base64 encoded bytes using pure Java serialization. If it happens that the value is not Serializable, a
ValueSerializationException is thrown.
Having type information in the serialized payload allows to keep actual ValueComposite types and by so
circumvent
AmbiguousTypeException when deserializing.