Package io.jenkins.plugins.checks.utils
Class FlowNodeUtils
java.lang.Object
io.jenkins.plugins.checks.utils.FlowNodeUtils
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
public class FlowNodeUtils
extends Object
Utility methods for working with FlowNodes.
-
Method Summary
Modifier and TypeMethodDescriptiongetEnclosingBlockNames(List<org.jenkinsci.plugins.workflow.graph.FlowNode> nodes) Get the stage and parallel branch names for these nodes, innermost first.static List<org.jenkinsci.plugins.workflow.graph.FlowNode> getEnclosingStagesAndParallels(org.jenkinsci.plugins.workflow.graph.FlowNode node) Get the stage and parallel branch start node IDs (not the body nodes) for this node, innermost first.static booleanisStageOrParallelBranchStart(org.jenkinsci.plugins.workflow.graph.FlowNode node) Whether this node starts a stage or a parallel branch.
-
Method Details
-
getEnclosingStagesAndParallels
@NonNull public static List<org.jenkinsci.plugins.workflow.graph.FlowNode> getEnclosingStagesAndParallels(org.jenkinsci.plugins.workflow.graph.FlowNode node) Get the stage and parallel branch start node IDs (not the body nodes) for this node, innermost first.- Parameters:
node- A flownode.- Returns:
- A nonnull, possibly empty list of stage/parallel branch start nodes, innermost first.
-
getEnclosingBlockNames
@NonNull public static List<String> getEnclosingBlockNames(@NonNull List<org.jenkinsci.plugins.workflow.graph.FlowNode> nodes) Get the stage and parallel branch names for these nodes, innermost first.- Parameters:
nodes- A flownode.- Returns:
- A nonnull, possibly empty list of stage/parallel branch names, innermost first.
-
isStageOrParallelBranchStart
public static boolean isStageOrParallelBranchStart(@NonNull org.jenkinsci.plugins.workflow.graph.FlowNode node) Whether this node starts a stage or a parallel branch. Atomic steps that merely have a label, such assh(label: 'x', ...), are not stage or branch start nodes.- Parameters:
node- A flownode.- Returns:
trueif the node is a labelled stage or parallel branch start node.
-