Record Class ModelGraphDocumentManifest

java.lang.Object
java.lang.Record
io.fluxzero.common.search.ModelGraphDocumentManifest

public record ModelGraphDocumentManifest(int version, long stateIndex, List<String> types, List<String> relationshipPaths, List<ModelGraphDocumentManifest.Node> nodes) extends Record
Hidden structural description carried by a composed independent-model graph document.

The visible document remains ordinary nested JSON. This compact, dictionary-encoded manifest preserves exact node identities, concrete types, revisions and placements so SDK clients can reconstruct and independently upcast a typed lazy graph without guessing schema information from JSON paths. Parent nodes always precede their children.

  • Field Details

    • CURRENT_VERSION

      public static final int CURRENT_VERSION
      Current manifest format version.
      See Also:
    • METADATA_KEY

      public static final String METADATA_KEY
      Reserved document-metadata key containing the manifest.
      See Also:
    • FACET_NAME

      public static final String FACET_NAME
      Internal facet marker that lets document trackers avoid inspecting ordinary document payloads.
      See Also:
    • TOMBSTONE_METADATA_KEY

      public static final String TOMBSTONE_METADATA_KEY
      Reserved metadata marker for a deleted materialized graph root.
      See Also:
    • PREVIOUS_STATE_INDEX_METADATA_KEY

      public static final String PREVIOUS_STATE_INDEX_METADATA_KEY
      Reserved tombstone metadata containing the last materialized state boundary before deletion.
      See Also:
  • Constructor Details

    • ModelGraphDocumentManifest

      public ModelGraphDocumentManifest(long stateIndex, List<String> types, List<String> relationshipPaths, List<ModelGraphDocumentManifest.Node> nodes)
    • ModelGraphDocumentManifest

      public ModelGraphDocumentManifest(int version, long stateIndex, List<String> types, List<String> relationshipPaths, List<ModelGraphDocumentManifest.Node> nodes)
      Creates an instance of a ModelGraphDocumentManifest record class.
      Parameters:
      version - the value for the version record component
      stateIndex - the value for the stateIndex record component
      types - the value for the types record component
      relationshipPaths - the value for the relationshipPaths record component
      nodes - the value for the nodes record component
  • Method Details

    • type

      Returns the concrete class name referenced by a node.
    • relationshipPath

      public String relationshipPath(ModelGraphDocumentManifest.Node node)
      Returns the relationship path referenced by a non-root node.
    • serialize

      public String serialize()
      Serializes this manifest for hidden search-document metadata.
    • from

      public static Optional<ModelGraphDocumentManifest> from(SerializedDocument document)
      Reads the manifest from a composed graph document when present.
    • isGraphDocument

      public static boolean isGraphDocument(SerializedDocument document)
      Returns whether a document advertises the hidden typed-graph manifest without decoding its metadata.
    • from

      public static Optional<ModelGraphDocumentManifest> from(Metadata metadata)
      Reads the manifest from document metadata when present.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • version

      public int version()
      Returns the value of the version record component.
      Returns:
      the value of the version record component
    • stateIndex

      public long stateIndex()
      Returns the value of the stateIndex record component.
      Returns:
      the value of the stateIndex record component
    • types

      public List<String> types()
      Returns the value of the types record component.
      Returns:
      the value of the types record component
    • relationshipPaths

      public List<String> relationshipPaths()
      Returns the value of the relationshipPaths record component.
      Returns:
      the value of the relationshipPaths record component
    • nodes

      Returns the value of the nodes record component.
      Returns:
      the value of the nodes record component