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<io.fluxzero.common.api.modeling.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<io.fluxzero.common.api.modeling.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<io.fluxzero.common.api.modeling.ModelGraphEdge> edges, ModelRepository repository, boolean historical, io.fluxzero.common.api.modeling.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<io.fluxzero.common.api.modeling.ModelGraphEdge> durableEdges, ModelRepository repository, boolean historical, io.fluxzero.common.api.modeling.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 <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 <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> 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> 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> 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.
-
Method Details
-
lazy
Creates a lazy one-model graph without loading relationships. -
lazy
Creates a detached graph whose model and relationship state remain lazy. -
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. -
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
-
compose
public static <T> Graph<T> compose(String rootId, long stateIndex, Map<String, Entity<?>> models, List<io.fluxzero.common.api.modeling.ModelGraphEdge> edges, ModelRepository repository, boolean historical, io.fluxzero.common.api.modeling.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<io.fluxzero.common.api.modeling.ModelGraphEdge> durableEdges, ModelRepository repository, boolean historical, io.fluxzero.common.api.modeling.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<io.fluxzero.common.api.modeling.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. -
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.
-