Class GlobalTextareaChoiceListEntry

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

        public int hashCode()
        Overrides:
        hashCode in class Object