Class CommonUtils
- java.lang.Object
-
- org.jenkinsci.plugins.pipeline.modeldefinition.CommonUtils
-
public class CommonUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description CommonUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> Map<String,Object>
copyMapReplacingEntry(Map<String,?> map, String oldKey, String newKey, Class<T> requiredValueType, Function<T,Object> replacer)
Copy a map, replacing the entry with the specified key if it matches the specified type.static List<org.jenkinsci.plugins.workflow.graph.FlowNode>
findPossiblyUnfinishedEndNodeForCurrentStage(String stageName)
static List<org.jenkinsci.plugins.workflow.graph.FlowNode>
findPossiblyUnfinishedEndNodeForCurrentStage(String stageName, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
static <T> T
instantiateDescribable(Class<T> c, Map<String,?> args)
static com.google.common.base.Predicate<org.jenkinsci.plugins.workflow.graph.FlowNode>
isSomewhereWithinStage(org.jenkinsci.plugins.workflow.graph.FlowNode stageStartNode)
This will return true for flow nodes in *child* stages, not just the immediate enclosing stage.static com.google.common.base.Predicate<org.jenkinsci.plugins.workflow.graph.FlowNode>
isStageWithOptionalName()
static com.google.common.base.Predicate<org.jenkinsci.plugins.workflow.graph.FlowNode>
isStageWithOptionalName(String stageName)
-
-
-
Method Detail
-
isStageWithOptionalName
public static com.google.common.base.Predicate<org.jenkinsci.plugins.workflow.graph.FlowNode> isStageWithOptionalName(String stageName)
-
isStageWithOptionalName
public static com.google.common.base.Predicate<org.jenkinsci.plugins.workflow.graph.FlowNode> isStageWithOptionalName()
-
findPossiblyUnfinishedEndNodeForCurrentStage
public static List<org.jenkinsci.plugins.workflow.graph.FlowNode> findPossiblyUnfinishedEndNodeForCurrentStage(String stageName, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
-
findPossiblyUnfinishedEndNodeForCurrentStage
public static List<org.jenkinsci.plugins.workflow.graph.FlowNode> findPossiblyUnfinishedEndNodeForCurrentStage(String stageName)
-
isSomewhereWithinStage
public static com.google.common.base.Predicate<org.jenkinsci.plugins.workflow.graph.FlowNode> isSomewhereWithinStage(org.jenkinsci.plugins.workflow.graph.FlowNode stageStartNode)
This will return true for flow nodes in *child* stages, not just the immediate enclosing stage.- Parameters:
stageStartNode
-- Returns:
- A predicate that returns true if the applied input is somewhere within the given stage
-
instantiateDescribable
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static <T> T instantiateDescribable(Class<T> c, Map<String,?> args)
-
-