Class GlobalVariableSet
- java.lang.Object
-
- org.jenkinsci.plugins.workflow.cps.GlobalVariableSet
-
- All Implemented Interfaces:
ExtensionPoint
,Iterable<GlobalVariable>
- Direct Known Subclasses:
GlobalVariableSet.GlobalVariableProvider
public abstract class GlobalVariableSet extends Object implements ExtensionPoint, Iterable<GlobalVariable>
Extension point that defines a collection of global variables.- Author:
- Kohsuke Kawaguchi
- See Also:
GlobalVariable.ALL
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GlobalVariableSet.GlobalVariableProvider
AllowGlobalVariable
s to be defined withExtension
, and make them discoverable viaGlobalVariableSet
.-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description GlobalVariableSet()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Collection<GlobalVariable>
forJob(Job<?,?> job)
Enumerate all global variables from this provider which should be associated with a given job.Collection<GlobalVariable>
forRun(Run<?,?> run)
Enumerate all global variables from this provider which should be associated with a given build.Iterator<GlobalVariable>
iterator()
Deprecated.implementforRun(hudson.model.Run<?, ?>)
instead-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
forRun
@NonNull public Collection<GlobalVariable> forRun(@CheckForNull Run<?,?> run)
Enumerate all global variables from this provider which should be associated with a given build.- Parameters:
run
- a build, which may or may not still be running; or may be left null to look for variables that exist without any context- Returns:
- a possibly empty set
-
forJob
@NonNull public Collection<GlobalVariable> forJob(@CheckForNull Job<?,?> job)
Enumerate all global variables from this provider which should be associated with a given job.- Parameters:
job
- a job; or may be left null to look for variables that exist without any context- Returns:
- a possibly empty set; by default delegates to
forRun(hudson.model.Run<?, ?>)
onJob.getLastSuccessfulBuild()
-
iterator
@Deprecated public Iterator<GlobalVariable> iterator()
Deprecated.implementforRun(hudson.model.Run<?, ?>)
instead- Specified by:
iterator
in interfaceIterable<GlobalVariable>
-
-