Class DefaultChoiceItem

java.lang.Object
org.jline.prompt.impl.DefaultChoiceItem
All Implemented Interfaces:
ChoiceItem, PromptItem

public class DefaultChoiceItem extends Object implements ChoiceItem
Default implementation of ChoiceItem interface.
  • Constructor Details

    • DefaultChoiceItem

      public DefaultChoiceItem(String name, String text, char key, String helpText, boolean defaultChoice)
    • DefaultChoiceItem

      public DefaultChoiceItem(String name, String text, char key)
  • Method Details

    • getName

      public String getName()
      Description copied from interface: PromptItem
      Get the name of this item.
      Specified by:
      getName in interface PromptItem
      Returns:
      the name
    • getText

      public String getText()
      Description copied from interface: PromptItem
      Get the text to display for this item.
      Specified by:
      getText in interface PromptItem
      Returns:
      the text
    • getKey

      public Character getKey()
      Description copied from interface: ChoiceItem
      Get the key associated with this choice.
      Specified by:
      getKey in interface ChoiceItem
      Returns:
      the key
    • getHelpText

      public String getHelpText()
    • isDefaultChoice

      public boolean isDefaultChoice()
      Description copied from interface: ChoiceItem
      Whether this choice is the default choice.
      Specified by:
      isDefaultChoice in interface ChoiceItem
      Returns:
      true if this choice is the default
    • toString

      public String toString()
      Overrides:
      toString in class Object