Class Graphs
java.lang.Object
io.fluxzero.sdk.modeling.Graphs
Construction boundary for the single indexed
Graph implementation.
Applications normally obtain graphs through injection or ModelRepository.loadGraph(Id).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordOne reachable parent identity in deterministic traversal order.static final recordDescription of one placement in a materialized graph manifest. -
Method Summary
Modifier and TypeMethodDescriptionstatic List<Graphs.AncestorPlacement> ancestors(Collection<String> roots, List<ModelGraphEdge> edges, int maxDepth, int maxModels) Indexes parent edges once and returns every ancestor reachable from the supplied model roots.static <T> Graph<T> compose(String rootId, long stateIndex, Map<String, Entity<?>> models, List<ModelGraphEdge> edges, ModelRepository repository, boolean historical) Creates a complete graph from one coherent repository reconstruction.static <T> Graph<T> compose(String rootId, long stateIndex, Map<String, Entity<?>> models, List<ModelGraphEdge> edges, ModelRepository repository, boolean historical, ModelReadBoundary boundary) Creates a complete graph while retaining its exact repository boundary for lazy relationship loads.static <T> Graph<T> compose(String rootId, long stateIndex, Map<String, Entity<?>> durableModels, List<ModelGraphEdge> durableEdges, ModelRepository repository, boolean historical, ModelReadBoundary boundary, String namespace, Class<T> rootType, Graph.Options options, Map<String, Entity<?>> staged, Function<Entity<?>, Graph<?>> supplementalLoader) Builds one indexed state with visible message-batch values applied before graph selection.static Entity<?> currentRootOverlay(Object requested, boolean exact, Class<?> expected, ModelRepository repository, ModelBatchScope.Snapshot snapshot, ModelGraphResolver.Identity identity) Selects the captured batch value that supersedes a root identity, without reading its durable body.static Entity<?> currentRootOverlay(Object requested, ModelIdResolution resolution, Class<?> expected, ModelRepository repository, ModelBatchScope.Snapshot snapshot, ModelGraphResolver.Identity identity) Selects a captured batch value using independent normalization and alias policy.static <T> Graph<T> filterBranches(Graph<T> graph, Predicate<? super Graph<?>> predicate) Returns a graph view containing matching branches and the ancestors required to reach them.static <T> Graph<T> lazy(Entity<T> entity, long stateIndex, ModelRepository repository) Creates a lazy one-model graph without loading relationships.static Graph<?> lazy(Object modelId, ModelRepository repository) Discovers an untyped root from its head while leaving its authoritative value lazy.static Graph<?> lazy(Object modelId, ModelRepository repository, boolean applyAffixes) Discovers the root at call time while optionally bypassing typed-ID conversion and affixes.static <T> Graph<T> lazy(Object parentId, Class<?> parentType, Object modelId, Class<T> modelType, ModelRepository repository) Creates a detached graph for a parent-scoped model.static <T> Graph<T> lazy(Object modelId, Class<T> modelType, ModelRepository repository) Creates a detached graph whose model and relationship state remain lazy.static <T> Graph<T> lazy(Object modelId, Class<T> modelType, ModelRepository repository, boolean applyAffixes) Creates a lazy alias-aware graph with optional ID conversion and affixes.static <T> Graph<T> lazyCurrent(Object modelId, Class<T> modelType, ModelRepository repository) Creates a graph whose root deliberately resolves to the latest state instead of a handler boundary.static <T> Graph<T> lazyCurrent(Object modelId, Class<T> modelType, ModelRepository repository, boolean applyAffixes) Creates a deliberately current alias-aware graph with optional ID conversion and affixes.static <T> Graph<T> lazyRepositoryId(String repositoryId, Class<T> modelType, ModelRepository repository) Creates a detached graph for an exact persisted identity.static <T> Graph<T> Returns a lazy view whose values are transformed independently on first access.static <T> Graph<T> materialized(List<Graphs.MaterializedNode> nodes, Class<T> rootType, long stateIndex, Long previousStateIndex, ModelRepository repository, Map<Class<?>, List<String>> declaredPaths, Map<String, String> pathOverrides) Creates the same indexed graph view for a materialized search document.static <T> Graph<T> pinnedRevision(Entity<T> entity, long stateIndex, ModelRepository repository) Internal result view retaining a known revision without consulting a subsequent current cache entry.static <T> Graph<T> remapPaths(Graph<T> graph, Map<String, String> pathOverrides) Returns an immutable graph view with remapped direct relationship paths.static <T> Graph<T> selectPaths(Graph<T> graph, Collection<String> paths) Returns a lazy immutable view containing only selected serialized relationship paths.static <T> Graph<T> withContext(Graph<T> graph, Collection<?> values) Returns an immutable graph view carrying response-wide typed context.static <T> Graph<T> withoutHistory(Graph<T> graph) Marks a live indexed view as having no retained previous Graph snapshot, including its descendants.
-
Method Details
-
lazy
Creates a lazy one-model graph without loading relationships. -
pinnedRevision
public static <T> Graph<T> pinnedRevision(Entity<T> entity, long stateIndex, ModelRepository repository) Internal result view retaining a known revision without consulting a subsequent current cache entry. -
lazy
Creates a detached graph whose model and relationship state remain lazy. -
lazy
public static <T> Graph<T> lazy(Object modelId, Class<T> modelType, ModelRepository repository, boolean applyAffixes) Creates a lazy alias-aware graph with optional ID conversion and affixes. -
lazyCurrent
public static <T> Graph<T> lazyCurrent(Object modelId, Class<T> modelType, ModelRepository repository) Creates a graph whose root deliberately resolves to the latest state instead of a handler boundary. -
lazyCurrent
public static <T> Graph<T> lazyCurrent(Object modelId, Class<T> modelType, ModelRepository repository, boolean applyAffixes) Creates a deliberately current alias-aware graph with optional ID conversion and affixes. -
lazy
Discovers an untyped root from its head while leaving its authoritative value lazy. -
lazy
Discovers the root at call time while optionally bypassing typed-ID conversion and affixes. -
currentRootOverlay
public static Entity<?> currentRootOverlay(Object requested, boolean exact, Class<?> expected, ModelRepository repository, ModelBatchScope.Snapshot snapshot, ModelGraphResolver.Identity identity) Selects the captured batch value that supersedes a root identity, without reading its durable body. -
currentRootOverlay
public static Entity<?> currentRootOverlay(Object requested, ModelIdResolution resolution, Class<?> expected, ModelRepository repository, ModelBatchScope.Snapshot snapshot, ModelGraphResolver.Identity identity) Selects a captured batch value using independent normalization and alias policy. -
lazyRepositoryId
public static <T> Graph<T> lazyRepositoryId(String repositoryId, Class<T> modelType, ModelRepository repository) Creates a detached graph for an exact persisted identity. -
lazy
-
compose
public static <T> Graph<T> compose(String rootId, long stateIndex, Map<String, Entity<?>> models, List<ModelGraphEdge> edges, ModelRepository repository, boolean historical) Creates a complete graph from one coherent repository reconstruction. -
compose
public static <T> Graph<T> compose(String rootId, long stateIndex, Map<String, Entity<?>> models, List<ModelGraphEdge> edges, ModelRepository repository, boolean historical, ModelReadBoundary boundary) Creates a complete graph while retaining its exact repository boundary for lazy relationship loads. -
compose
public static <T> Graph<T> compose(String rootId, long stateIndex, Map<String, Entity<?>> durableModels, List<ModelGraphEdge> durableEdges, ModelRepository repository, boolean historical, ModelReadBoundary boundary, String namespace, Class<T> rootType, Graph.Options options, Map<String, Entity<?>> staged, Function<Entity<?>, Graph<?>> supplementalLoader) Builds one indexed state with visible message-batch values applied before graph selection. -
ancestors
public static List<Graphs.AncestorPlacement> ancestors(Collection<String> roots, List<ModelGraphEdge> edges, int maxDepth, int maxModels) Indexes parent edges once and returns every ancestor reachable from the supplied model roots. -
materialized
public static <T> Graph<T> materialized(List<Graphs.MaterializedNode> nodes, Class<T> rootType, long stateIndex, Long previousStateIndex, ModelRepository repository, Map<Class<?>, List<String>> declaredPaths, Map<String, String> pathOverrides) Creates the same indexed graph view for a materialized search document. -
withoutHistory
-
mapValues
-
remapPaths
-
withContext
Returns an immutable graph view carrying response-wide typed context. -
filterBranches
-
selectPaths
Returns a lazy immutable view containing only selected serialized relationship paths.
-