Package io.fluxcapacitor.common.search
Enum Class DefaultDocumentSerializer
- All Implemented Interfaces:
Serializable
,Comparable<DefaultDocumentSerializer>
,Constable
Default serializer for
Document
instances in the Flux platform.
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:int
format version (currently0
)String
document IDInstant
timestamp (as epoch millis)Instant
end timestamp (as epoch millis)String
collection 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 java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionboolean
canDeserialize
(Data<byte[]> data) Checks whether the givenData
object is in a format that this serializer can deserialize.deserialize
(Data<byte[]> document) Data
<byte[]> static DefaultDocumentSerializer
Returns 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 aData
blob 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
Document
- Throws:
IllegalArgumentException
- if the data cannot be parsed or is invalid
-
canDeserialize
Checks whether the givenData
object is in a format that this serializer can deserialize.- Parameters:
data
- the data blob- Returns:
true
if the format isdocument
,false
otherwise
-