Class Graphs

java.lang.Object
io.fluxzero.sdk.modeling.Graphs

public final class Graphs extends Object
Construction boundary for the single indexed Graph implementation.

Applications normally obtain graphs through injection or ModelRepository.loadGraph(Id).

  • Method Details

    • lazy

      public static <T> Graph<T> lazy(Entity<T> entity, long stateIndex, ModelRepository repository)
      Creates a lazy one-model graph without loading relationships.
    • lazy

      public static <T> Graph<T> lazy(Object modelId, Class<T> modelType, ModelRepository repository)
      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

      public 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.
    • 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)
      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<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

      public static <T> Graph<T> mapValues(Graph<T> graph, Function<? super Graph<?>, ?> mapper)
      Returns a lazy view whose values are transformed independently on first access.
    • remapPaths

      public static <T> Graph<T> remapPaths(Graph<T> graph, Map<String,String> pathOverrides)
      Returns an immutable graph view with remapped direct relationship paths.
    • withContext

      public static <T> Graph<T> withContext(Graph<T> graph, Collection<?> values)
      Returns an immutable graph view carrying response-wide typed context.
    • filterBranches

      public 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.
    • selectPaths

      public static <T> Graph<T> selectPaths(Graph<T> graph, Collection<String> paths)
      Returns a lazy immutable view containing only selected serialized relationship paths.