Interface ChoiceBuilder

    • Method Detail

      • newChoice

        ChoiceBuilder newChoice​(java.lang.String id)
        Create a new choice with the given ID.
        Parameters:
        id - the ID
        Returns:
        this builder
      • key

        ChoiceBuilder key​(char key)
        Set the key for the current choice.
        Parameters:
        key - the key
        Returns:
        this builder
      • text

        ChoiceBuilder text​(java.lang.String text)
        Set the text for the current choice.
        Parameters:
        text - the text
        Returns:
        this builder
      • helpText

        ChoiceBuilder helpText​(java.lang.String helpText)
        Set the help text for the current choice.
        Parameters:
        helpText - the help text
        Returns:
        this builder
      • defaultChoice

        ChoiceBuilder defaultChoice​(boolean defaultChoice)
        Set whether the current choice is the default.
        Parameters:
        defaultChoice - whether the choice is the default
        Returns:
        this builder
      • add

        ChoiceBuilder add()
        Add the current choice to the list.
        Returns:
        this builder
      • add

        default ChoiceBuilder add​(java.lang.String name,
                                  java.lang.String text,
                                  char key)
        Convenience method to add a simple choice item with name, text, and key.
        Parameters:
        name - the item name/id
        text - the display text
        key - the key to select this choice
        Returns:
        this builder
      • add

        default ChoiceBuilder add​(java.lang.String name,
                                  java.lang.String text,
                                  char key,
                                  boolean defaultChoice)
        Convenience method to add a choice item with name, text, key, and default state.
        Parameters:
        name - the item name/id
        text - the display text
        key - the key to select this choice
        defaultChoice - whether this is the default choice
        Returns:
        this builder
      • add

        default ChoiceBuilder add​(java.lang.String name,
                                  java.lang.String text,
                                  char key,
                                  java.lang.String helpText,
                                  boolean defaultChoice)
        Convenience method to add a choice item with all options.
        Parameters:
        name - the item name/id
        text - the display text
        key - the key to select this choice
        helpText - the help text for this choice
        defaultChoice - whether this is the default choice
        Returns:
        this builder