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

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

      public static Graph<?> lazy(Object modelId, ModelRepository repository)
      Discovers an untyped root from its head while leaving its authoritative value lazy.
    • lazy

      public static Graph<?> lazy(Object modelId, ModelRepository repository, boolean applyAffixes)
      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

      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<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

      public static <T> Graph<T> withoutHistory(Graph<T> graph)
      Marks a live indexed view as having no retained previous Graph snapshot, including its descendants.
    • 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.