Class GlobalTextareaChoiceListEntry
java.lang.Object
hudson.model.AbstractDescribableImpl<GlobalTextareaChoiceListEntry>
jp.ikedam.jenkins.plugins.extensible_choice_parameter.GlobalTextareaChoiceListEntry
- All Implemented Interfaces:
Describable<GlobalTextareaChoiceListEntry>
,Serializable
public class GlobalTextareaChoiceListEntry
extends AbstractDescribableImpl<GlobalTextareaChoiceListEntry>
implements Serializable
A set of choices that can be used in Global Choice Parameter.
Holds a name and a list of choices.
Added in the System Configuration page.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
The internal class to work with views. -
Constructor Summary
ConstructorsConstructorDescriptionGlobalTextareaChoiceListEntry
(String name, String choiceListText, boolean allowAddEditedValue) Constructor instantiating with parameters in the configuration page. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addEditedValue
(String value) boolean
The list of choices.The list of choices, joined into a string.getName()
the name of this set of choices.static Pattern
int
hashCode()
boolean
Return whether users can add a new value by building a job using this choice list.boolean
isValid()
Returns whether this object is configured correctly.protected void
setChoiceList
(List<String> choiceList) Set choiceListtoString()
Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
Constructor Details
-
GlobalTextareaChoiceListEntry
@DataBoundConstructor public GlobalTextareaChoiceListEntry(String name, String choiceListText, boolean allowAddEditedValue) Constructor instantiating with parameters in the configuration page. When instantiating from the saved configuration, the object is directly serialized with XStream, and no constructor is used.- Parameters:
name
- the name of this set of choices.choiceListText
- the text where choices are written in each line.allowAddEditedValue
- whether users can add a new value by building a job using this choice list.
-
-
Method Details
-
getNamePattern
- Returns:
- A regular expression pattern for the acceptable names.
-
getName
the name of this set of choices.- Returns:
- the name the user specified.
-
getChoiceList
The list of choices.- Returns:
- the list of choices the user specified.
-
getChoiceListText
The list of choices, joined into a string. Used for filling a field when the configuration page is shown. The newline code is appended also after the last element.- Returns:
- Joined choices.
-
setChoiceList
Set choiceList- Parameters:
choiceList
- the choiceList to set
-
isAllowAddEditedValue
public boolean isAllowAddEditedValue()Return whether users can add a new value by building a job using this choice list.- Returns:
- the allowAddEditedValue
-
isValid
public boolean isValid()Returns whether this object is configured correctly. Jenkins framework seems to accept the values that doCheckXXX alerts an error. Throwing a exception from the constructor annotated with DataBoundConstructor results in an exception page, so I decided to omit bad objects with this method.- Returns:
- whether this object is configured correctly.
-
addEditedValue
- Parameters:
value
-
-
equals
-
hashCode
public int hashCode() -
toString
-