Class FlowScanningUtils
- java.lang.Object
-
- org.jenkinsci.plugins.workflow.graphanalysis.FlowScanningUtils
-
public final class FlowScanningUtils extends Object
Library of common functionality when analyzing/walking flow graphs- Author:
- Sam Van Oort
-
-
Field Summary
Fields Modifier and Type Field Description static Comparator<FlowNode>
ID_ORDER_COMPARATOR
static com.google.common.base.Predicate<FlowNode>
MATCH_BLOCK_START
static Comparator<FlowNode>
TIME_ORDER_COMPARATOR
Sorts flownodes putting the one begun last (oldest startTime) at the end, with null times last because likely they represent the newest nodes with aTimingAction
not attached yet.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static Filterator<FlowNode>
fetchEnclosingBlocks(FlowNode f)
Deprecated.static com.google.common.base.Predicate<FlowNode>
hasActionPredicate(Class<? extends Action> actionClass)
Create a predicate that will match on all FlowNodes having a specific action present
-
-
-
Field Detail
-
MATCH_BLOCK_START
public static final com.google.common.base.Predicate<FlowNode> MATCH_BLOCK_START
-
TIME_ORDER_COMPARATOR
public static final Comparator<FlowNode> TIME_ORDER_COMPARATOR
Sorts flownodes putting the one begun last (oldest startTime) at the end, with null times last because likely they represent the newest nodes with aTimingAction
not attached yet.
-
ID_ORDER_COMPARATOR
public static final Comparator<FlowNode> ID_ORDER_COMPARATOR
-
-
Method Detail
-
hasActionPredicate
@NonNull public static com.google.common.base.Predicate<FlowNode> hasActionPredicate(@NonNull Class<? extends Action> actionClass)
Create a predicate that will match on all FlowNodes having a specific action present- Parameters:
actionClass
- Action class to look for- Returns:
- Predicate that will match when FlowNode has the action given
-
fetchEnclosingBlocks
@NonNull @Deprecated public static Filterator<FlowNode> fetchEnclosingBlocks(@NonNull FlowNode f)
Deprecated.Returns allBlockStartNode
s enclosing the given FlowNode, starting from the inside out. This is useful if we want to obtain information about its scope, such as the workspace, parallel branch, or label. Warning: while this is efficient for one node, batch operations are far more efficient when handling many nodes.Deprecated, prefer
FlowNode.iterateEnclosingBlocks()
instead, possibly usingFilteratorImpl(Iterator, Predicate)
or Guava or Java 8 APIs if filtering needed.- Parameters:
f
-FlowNode
to start from.- Returns:
- Iterator that returns all enclosing BlockStartNodes from the inside out.
-
-