Class PromotedBuildParameterDefinition
- java.lang.Object
-
- hudson.model.ParameterDefinition
-
- hudson.model.SimpleParameterDefinition
-
- hudson.plugins.promoted_builds.parameters.PromotedBuildParameterDefinition
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<ParameterDefinition>
,Serializable
public class PromotedBuildParameterDefinition extends SimpleParameterDefinition
Defines a parameter that allows the user to select a promoted build from a drop down list.Remarks on addressing: Starting from TODO, the field also supports folders and the relative addressing (JENKINS-25011). See
ItemPathResolver.getByPath(java.lang.String, hudson.model.Item, java.lang.Class)
for the documentation.- Author:
- Pete Hayes
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PromotedBuildParameterDefinition.DescriptorImpl
-
Nested classes/interfaces inherited from class hudson.model.ParameterDefinition
ParameterDefinition.ParameterDescriptor
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
-
Fields inherited from class hudson.model.ParameterDefinition
LIST
-
-
Constructor Summary
Constructors Constructor Description PromotedBuildParameterDefinition(String name, String jobName, String process, String description)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ParameterDefinition
copyWithDefaultValue(ParameterValue defaultValue)
PromotedBuildParameterValue
createValue(String value)
PromotedBuildParameterValue
createValue(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject jo)
List
getBuilds()
Deprecated.This method retrieves the base item for relative addressing from theStaplerRequest
.PromotedBuildParameterValue
getDefaultParameterValue()
String
getJobName()
Absolute path to the item starting from the root element.String
getProcess()
List<Run<?,?>>
getRuns(Item base)
Gets a list of promoted builds for the project.-
Methods inherited from class hudson.model.SimpleParameterDefinition
createValue, createValue
-
Methods inherited from class hudson.model.ParameterDefinition
all, equals, getDescription, getDescriptor, getFormattedDescription, getName, getType, hashCode, isValid, setDescription
-
-
-
-
Method Detail
-
createValue
public PromotedBuildParameterValue createValue(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject jo)
- Specified by:
createValue
in classParameterDefinition
-
createValue
public PromotedBuildParameterValue createValue(String value)
- Specified by:
createValue
in classSimpleParameterDefinition
-
getDefaultParameterValue
public PromotedBuildParameterValue getDefaultParameterValue()
- Overrides:
getDefaultParameterValue
in classParameterDefinition
-
copyWithDefaultValue
public ParameterDefinition copyWithDefaultValue(ParameterValue defaultValue)
- Overrides:
copyWithDefaultValue
in classParameterDefinition
-
getJobName
@Exported public String getJobName()
Absolute path to the item starting from the root element.
-
getProcess
@Exported public String getProcess()
-
getBuilds
@NonNull @Deprecated public List getBuilds()
Deprecated.This method retrieves the base item for relative addressing from theStaplerRequest
. The relative addressing may be malfunctional if you use this method outsideStaplerRequest
s. UsegetRuns(hudson.model.Item)
insteadGets a list of promoted builds for the project.- Returns:
- List of
AbstractBuild
s, which have been promoted
-
getRuns
@NonNull public List<Run<?,?>> getRuns(@CheckForNull Item base)
Gets a list of promoted builds for the project.- Parameters:
base
- Base item for the relative addressing- Returns:
- List of
AbstractBuild
s, which have been promoted. May return an empty list ifJenkins
instance is not ready - Since:
- 2.22
-
-