Class EditableChoiceParameterDefinition

    • Constructor Detail

      • EditableChoiceParameterDefinition

        @DataBoundConstructor
        public EditableChoiceParameterDefinition​(@NonNull
                                                 String name)
        ctor.
        Parameters:
        name - the name of the parameter
    • Method Detail

      • setChoices

        @DataBoundSetter
        public void setChoices​(@NonNull
                               List<String> choices)
        Parameters:
        choices - choices used as candidates
      • getChoices

        @Exported
        public List<String> getChoices()
        Returns:
        choices
      • choicesFromText

        @NonNull
        public static List<String> choicesFromText​(@NonNull
                                                   String text)
        Parameters:
        text - choices delimited with new lines
        Returns:
        choices
      • textFromChoices

        public static String textFromChoices​(@NonNull
                                             List<String> choices)
        Parameters:
        choices - choices
        Returns:
        choices with delimited with new lines
      • setChoicesWithText

        @DataBoundSetter
        public void setChoicesWithText​(@NonNull
                                       String choicesWithText)
        Parameters:
        choicesWithText - choices with delimited with new lines
      • getChoicesWithText

        @NonNull
        public String getChoicesWithText()
        Returns:
        choices with delimited with new lines
      • setDefaultValue

        @DataBoundSetter
        public void setDefaultValue​(@CheckForNull
                                    String defaultValue)
        Parameters:
        defaultValue - the default value. The top choice is used if null.
      • getDefaultValue

        @Exported
        @CheckForNull
        public String getDefaultValue()
        Returns:
        the default value. The top choice is used if null.
      • setWithDefaultValue

        @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
        @DataBoundSetter
        public void setWithDefaultValue​(@NonNull
                                        DefaultValue defaultValue)
        Set the default value with DefaultValue. Only for used with <f:optionalBlock>. Use setDefaultValue(String) instead.
        Parameters:
        defaultValue - the default value with DefaultValue
      • getWithDefaultValue

        @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
        @CheckForNull
        public DefaultValue getWithDefaultValue()
        Return the default value with DefaultValue. Only for used with <f:optionalBlock>. Use getDefaultValue() instead.
        Returns:
        the default value with DefaultValue
      • setRestrict

        @DataBoundSetter
        public void setRestrict​(boolean restrict)
        Parameters:
        restrict - whether restrict value in choices
      • isRestrict

        @Exported
        public boolean isRestrict()
        Returns:
        whether restrict value in choices
      • withRestrict

        public EditableChoiceParameterDefinition withRestrict​(boolean restrict)
        Parameters:
        restrict - whether restrict value in choices
        Returns:
        this instance
      • setFilterConfig

        @DataBoundSetter
        public void setFilterConfig​(@CheckForNull
                                    FilterConfig filterConfig)
        Parameters:
        filterConfig - how to filter values for input. null not to filter.
      • getFilterConfig

        @CheckForNull
        public FilterConfig getFilterConfig()
        Returns:
        how to filter values for input. null not to filter.
      • createDefaultValue

        @CheckForNull
        public String createDefaultValue()
        Returns:
        the default value. the top most value if not configured.
      • checkValue

        protected boolean checkValue​(@NonNull
                                     String value)
        Parameters:
        value - candidate input
        Returns:
        whether the value is allowed (e.g. value in choices)