Enum Class DefaultDocumentSerializer
- All Implemented Interfaces:
Serializable, Comparable<DefaultDocumentSerializer>, Constable
Default serializer for
Document instances in the Fluxzero Runtime.
This serializer uses the MessagePack binary format to efficiently encode and decode documents for storage or transport. It supports compression and is version-aware, allowing for future extension of the format.
Serialization Format
The current (version 0) serialization includes:intformat version (currently0)Stringdocument IDInstanttimestamp (as epoch millis)Instantend timestamp (as epoch millis)Stringcollection nameList<Entry>entries and their associatedList<Path>
Compression is applied to the final byte output using CompressionUtils and marked with the format document
via Data.DOCUMENT_FORMAT.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionbooleancanDeserialize(Data<byte[]> data) Checks whether the givenDataobject is in a format that this serializer can deserialize.deserialize(Data<byte[]> document) Data<byte[]> static DefaultDocumentSerializerReturns the enum constant of this class with the specified name.static DefaultDocumentSerializer[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INSTANCE
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
serialize
- Parameters:
document- the document to serialize- Returns:
- the serialized form of the document
- Throws:
IllegalArgumentException- if the document cannot be serialized
-
deserialize
Deserializes aDatablob containing a compressed, binaryDocument. The data must be in the correct format and contain a supported version.- Parameters:
document- the data to deserialize- Returns:
- the reconstructed
Documententries - Throws:
IllegalArgumentException- if the data cannot be parsed or is invalid
-
canDeserialize
-