Class DefaultPasswordPrompt

All Implemented Interfaces:
InputPrompt, PasswordPrompt, Prompt

public class DefaultPasswordPrompt extends DefaultInputPrompt implements PasswordPrompt
Default implementation of PasswordPrompt interface.
  • Constructor Details

    • DefaultPasswordPrompt

      public DefaultPasswordPrompt(String name, String message)
    • DefaultPasswordPrompt

      public DefaultPasswordPrompt(String name, String message, Character mask)
    • DefaultPasswordPrompt

      public DefaultPasswordPrompt(String name, String message, Character mask, boolean showMask)
    • DefaultPasswordPrompt

      public DefaultPasswordPrompt(String name, String message, String defaultValue, Character mask, boolean showMask)
  • Method Details

    • showMask

      public boolean showMask()
      Description copied from interface: PasswordPrompt
      Whether to show the mask character in the post-input display result. When true, the display result shows mask characters for each typed character. When false, the display result is empty (no visible feedback after input).

      Note: this controls only the post-input display value returned by PromptResult.getDisplayResult(), not what is shown during typing. To suppress all visible feedback while typing, use mask('\0').

      Specified by:
      showMask in interface PasswordPrompt
      Returns:
      true to show mask characters in the result, false to hide completely
    • getMask

      public Character getMask()
      Description copied from interface: InputPrompt
      Get the mask character for the input.
      Specified by:
      getMask in interface InputPrompt
      Specified by:
      getMask in interface PasswordPrompt
      Overrides:
      getMask in class DefaultInputPrompt
      Returns:
      the mask character, or null if masking is disabled
    • getCompleter

      public org.jline.reader.Completer getCompleter()
      Description copied from interface: InputPrompt
      Get the completer.
      Specified by:
      getCompleter in interface InputPrompt
      Overrides:
      getCompleter in class DefaultInputPrompt
      Returns:
      the completer