Interface ChoiceBuilder

All Superinterfaces:
BaseBuilder<ChoiceBuilder>
All Known Implementing Classes:
DefaultChoiceBuilder

public interface ChoiceBuilder extends BaseBuilder<ChoiceBuilder>
Builder for choice prompts.
  • Method Details

    • newChoice

      ChoiceBuilder newChoice(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(String text)
      Set the text for the current choice.
      Parameters:
      text - the text
      Returns:
      this builder
    • helpText

      ChoiceBuilder helpText(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

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

      default ChoiceBuilder add(String name, 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(String name, 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(String name, String text, char key, 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