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:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GlobalTextareaChoiceListEntry.DescriptorImpl
The internal class to work with views.
-
Constructor Summary
Constructors Constructor Description GlobalTextareaChoiceListEntry(String name, String choiceListText, boolean allowAddEditedValue)
Constructor instantiating with parameters in the configuration page.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEditedValue(String value)
boolean
equals(Object o)
List<String>
getChoiceList()
The list of choices.String
getChoiceListText()
The list of choices, joined into a string.String
getName()
the name of this set of choices.static Pattern
getNamePattern()
int
hashCode()
boolean
isAllowAddEditedValue()
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 choiceListString
toString()
-
Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
-
-
-
Constructor Detail
-
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 Detail
-
getNamePattern
public static Pattern getNamePattern()
- Returns:
- A regular expression pattern for the acceptable names.
-
getName
public String getName()
the name of this set of choices.- Returns:
- the name the user specified.
-
getChoiceList
public List<String> getChoiceList()
The list of choices.- Returns:
- the list of choices the user specified.
-
getChoiceListText
public String 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
protected void setChoiceList(List<String> choiceList)
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
public void addEditedValue(String value)
- Parameters:
value
-
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classObject
- Parameters:
o
-- Returns:
- See Also:
Object.equals(java.lang.Object)
-
toString
public String toString()
- Overrides:
toString
in classObject
- Returns:
- See Also:
Object.toString()
-
-