Package io.fluxcapacitor.common.search
Interface Inverter<T>
- Type Parameters:
T
- the type of object that can be inverted and deserialized
- All Superinterfaces:
Converter<byte[],
T>
- All Known Implementing Classes:
JacksonInverter
Interface responsible for converting a domain object into a
SerializedDocument
for indexing, and vice
versa—deserializing a byte[]
representation into the original object type.
An Inverter
is a specialized Converter
used in the search module. It bridges the gap between
serializable objects and searchable document formats. Implementations handle both document creation and
deserialization from raw data.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiontoDocument
(Object object, String type, int revision, String id, String collection, Instant timestamp, Instant end, Metadata metadata) Converts the given object into aSerializedDocument
, which is suitable for indexing or storage in a document store.Methods inherited from interface io.fluxcapacitor.common.serialization.Converter
convert, convertFormat, getOutputType
-
Method Details
-
toDocument
SerializedDocument toDocument(Object object, String type, int revision, String id, String collection, Instant timestamp, Instant end, Metadata metadata) Converts the given object into aSerializedDocument
, which is suitable for indexing or storage in a document store.- Parameters:
object
- the original object to converttype
- the simple type name of the objectrevision
- the revision number of the object (e.g., as provided byRevision
)id
- the unique ID for this document within the given collectioncollection
- the name of the collection the document belongs totimestamp
- the optional starting timestamp for the document's validityend
- the optional end timestamp of the document's validitymetadata
- optional metadata to associate with the document- Returns:
- a fully constructed
SerializedDocument
-