Class MultiselectParameterDefinition
- java.lang.Object
-
- hudson.model.ParameterDefinition
-
- de.westemeyer.plugins.multiselect.MultiselectParameterDefinition
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<ParameterDefinition>
,Serializable
public class MultiselectParameterDefinition extends ParameterDefinition
The Parameter definition object is responsible for all communication between Jenkins and plugin code.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MultiselectParameterDefinition.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 MultiselectParameterDefinition(String name, String description)
Create new parameter definition object.MultiselectParameterDefinition(String name, String description, MultiselectDecisionTree decisionTree, MultiselectConfigurationFormat format)
Create new parameter definition object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Queue<Integer>
createCoordinates(Integer... coordinates)
Create coordinates queue from integer array.MultiselectParameterValue
createValue(Map<String,Object> jsonObject)
Extracted method reduced to use of Map instead of JSONObject for unit tests.ParameterValue
createValue(org.kohsuke.stapler.StaplerRequest staplerRequest)
ParameterValue
createValue(org.kohsuke.stapler.StaplerRequest staplerRequest, net.sf.json.JSONObject jsonObject)
boolean
equals(Object o)
MultiselectDecisionTree
getDecisionTree()
Get decision tree object containing all possible variable combinations.ParameterValue
getDefaultParameterValue()
MultiselectConfigurationFormat
getFormat()
Get content/parser format.String[]
getItemList(Integer[] coordinates)
Get item list for AJAX call from config.jelly.String
getUuid()
Get UUID to be used to distinguish JavaScript values for multiple parameters from each other.int
hashCode()
void
setDecisionTree(MultiselectDecisionTree decisionTree)
Set decision tree object containing all possible variable combinations.void
setFormat(MultiselectConfigurationFormat format)
Set content/parser format.void
setUuid(String uuid)
Set unique ID value.-
Methods inherited from class hudson.model.ParameterDefinition
all, copyWithDefaultValue, createValue, getDescription, getDescriptor, getFormattedDescription, getName, getType, isValid, setDescription
-
-
-
-
Constructor Detail
-
MultiselectParameterDefinition
@DataBoundConstructor public MultiselectParameterDefinition(String name, String description)
Create new parameter definition object.- Parameters:
name
- parameter namedescription
- parameter description
-
MultiselectParameterDefinition
public MultiselectParameterDefinition(String name, String description, @CheckForNull MultiselectDecisionTree decisionTree, @CheckForNull MultiselectConfigurationFormat format)
Create new parameter definition object.- Parameters:
name
- parameter namedescription
- parameter descriptiondecisionTree
- parsed parameter definitionformat
- format, currently only CSV
-
-
Method Detail
-
getItemList
@JavaScriptMethod public String[] getItemList(Integer[] coordinates)
Get item list for AJAX call from config.jelly.- Parameters:
coordinates
- coordinates in tree, i.e. item indices from columns- Returns:
- array of parameter values for given coordinates
-
createCoordinates
public static Queue<Integer> createCoordinates(Integer... coordinates)
Create coordinates queue from integer array.- Parameters:
coordinates
- integer array- Returns:
- queue for use in visitor method
-
getDefaultParameterValue
@Nullable public ParameterValue getDefaultParameterValue()
- Overrides:
getDefaultParameterValue
in classParameterDefinition
-
createValue
public ParameterValue createValue(org.kohsuke.stapler.StaplerRequest staplerRequest, net.sf.json.JSONObject jsonObject)
- Specified by:
createValue
in classParameterDefinition
-
createValue
public MultiselectParameterValue createValue(Map<String,Object> jsonObject)
Extracted method reduced to use of Map instead of JSONObject for unit tests.- Parameters:
jsonObject
- map of parsed json contents- Returns:
- parameter value
-
createValue
public ParameterValue createValue(org.kohsuke.stapler.StaplerRequest staplerRequest)
- Specified by:
createValue
in classParameterDefinition
-
getDecisionTree
@CheckForNull public MultiselectDecisionTree getDecisionTree()
Get decision tree object containing all possible variable combinations.- Returns:
- decision tree object containing all possible variable combinations
-
setDecisionTree
@DataBoundSetter public void setDecisionTree(@CheckForNull MultiselectDecisionTree decisionTree)
Set decision tree object containing all possible variable combinations.- Parameters:
decisionTree
- decision tree object containing all possible variable combinations
-
getFormat
@CheckForNull public MultiselectConfigurationFormat getFormat()
Get content/parser format.- Returns:
- content/parser format
-
setFormat
@DataBoundSetter public void setFormat(@CheckForNull MultiselectConfigurationFormat format)
Set content/parser format.- Parameters:
format
- content/parser format
-
getUuid
public String getUuid()
Get UUID to be used to distinguish JavaScript values for multiple parameters from each other.- Returns:
- UUID to be used to distinguish JavaScript values for multiple parameters from each other
-
setUuid
public void setUuid(String uuid)
Set unique ID value.- Parameters:
uuid
- the new UUID to use for this object
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classParameterDefinition
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classParameterDefinition
-
-