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:
  • 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

      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 class Object
      Parameters:
      o -
      Returns:
      See Also:
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      See Also: