Annotation Type Serial.Structural
-
@Target({TYPE,PACKAGE,ANNOTATION_TYPE}) public static @interface Serial.StructuralAnnotation to generate structural serialization. Could be applied to types, enclosing types, enclosing packages and as meta-annotation.Structural serialization of value types use attribute names, collections, optional values and map into the representation, rather than exact internal fields used to store the data. The important aspect of this is that objects are being deserialized using their constructors and builders, and not the internal representation, thus all singletons, interning and other invariants will be preserved and data migration made possible (using either optional or nullable attributes) or changing types of collections, moving from scalar values to collections etc. Constuction using builder and constructor (if builder is disabled) is supported.
If
Serial.Structuralserialization is used and noserialVersionUIDis declared, i.e.Serial.Versionannotation is missing, serialized form will have serial version 0L assigned.