Record Class LiveGraphSnapshot

java.lang.Object
java.lang.Record
io.jenkins.plugins.pipelinegraphview.livestate.LiveGraphSnapshot

public record LiveGraphSnapshot(List<org.jenkinsci.plugins.workflow.graph.FlowNode> nodes, List<org.jenkinsci.plugins.workflow.graph.FlowNode> workspaceNodes, Map<String,List<String>> enclosingIdsByNodeId, Set<String> hideFromViewBlockStartIds, Set<String> activeNodeIds, long version) extends Record
Projection of a LiveGraphState at a point in time.

Consumers must treat every collection here as read-only. enclosingIdsByNodeId and hideFromViewBlockStartIds are the live concurrent structures from the underlying state — the CPS VM thread continues to write to them while the snapshot is in use. Iteration is safe (weakly consistent), mutation is not.

enclosingIdsByNodeId carries each captured node's ancestor chain so graph construction can resolve parentage without touching the execution's FlowNode storage.

hideFromViewBlockStartIds is the set of hideFromView block-start IDs, so callers can derive a step's "hidden" flag by intersecting with the step's enclosing IDs.

activeNodeIds contains the IDs of all nodes considered "active" at snapshot time: the execution's current heads plus every enclosing block start. Status resolution reads liveness from this set.

version is a monotonic counter that bumps on every new flow node, so callers can use it as a cache key for computed DTOs.

  • Constructor Summary

    Constructors
    Constructor
    Description
    LiveGraphSnapshot(List<org.jenkinsci.plugins.workflow.graph.FlowNode> nodes, List<org.jenkinsci.plugins.workflow.graph.FlowNode> workspaceNodes, Map<String,List<String>> enclosingIdsByNodeId, Set<String> hideFromViewBlockStartIds, Set<String> activeNodeIds, long version)
    Creates an instance of a LiveGraphSnapshot record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the activeNodeIds record component.
    Returns the value of the enclosingIdsByNodeId record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    Returns the value of the hideFromViewBlockStartIds record component.
    List<org.jenkinsci.plugins.workflow.graph.FlowNode>
    Returns the value of the nodes record component.
    final String
    Returns a string representation of this record class.
    long
    Returns the value of the version record component.
    List<org.jenkinsci.plugins.workflow.graph.FlowNode>
    Returns the value of the workspaceNodes record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • LiveGraphSnapshot

      public LiveGraphSnapshot(List<org.jenkinsci.plugins.workflow.graph.FlowNode> nodes, List<org.jenkinsci.plugins.workflow.graph.FlowNode> workspaceNodes, Map<String,List<String>> enclosingIdsByNodeId, Set<String> hideFromViewBlockStartIds, Set<String> activeNodeIds, long version)
      Creates an instance of a LiveGraphSnapshot record class.
      Parameters:
      nodes - the value for the nodes record component
      workspaceNodes - the value for the workspaceNodes record component
      enclosingIdsByNodeId - the value for the enclosingIdsByNodeId record component
      hideFromViewBlockStartIds - the value for the hideFromViewBlockStartIds record component
      activeNodeIds - the value for the activeNodeIds record component
      version - the value for the version record component
  • Method Details

    • 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 '=='.
      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.
    • nodes

      public List<org.jenkinsci.plugins.workflow.graph.FlowNode> nodes()
      Returns the value of the nodes record component.
      Returns:
      the value of the nodes record component
    • workspaceNodes

      public List<org.jenkinsci.plugins.workflow.graph.FlowNode> workspaceNodes()
      Returns the value of the workspaceNodes record component.
      Returns:
      the value of the workspaceNodes record component
    • enclosingIdsByNodeId

      public Map<String,List<String>> enclosingIdsByNodeId()
      Returns the value of the enclosingIdsByNodeId record component.
      Returns:
      the value of the enclosingIdsByNodeId record component
    • hideFromViewBlockStartIds

      public Set<String> hideFromViewBlockStartIds()
      Returns the value of the hideFromViewBlockStartIds record component.
      Returns:
      the value of the hideFromViewBlockStartIds record component
    • activeNodeIds

      public Set<String> activeNodeIds()
      Returns the value of the activeNodeIds record component.
      Returns:
      the value of the activeNodeIds record component
    • version

      public long version()
      Returns the value of the version record component.
      Returns:
      the value of the version record component