Hyphen
Hyphen copied to clipboard
Open subclass serialisation
It could be useful to allow any subclass for a given field.
This would work by first encoding the class name, and then using the serializer for that class. When decoding, the string is read, and a dynamic lookup for the deserializer is done. It might also be beneficial to also store the hashcode into the field too to speedup the lookup.
This could then also be extended to functional interfaces, allowing any static method reference to be selected as a lambda.