Interface PasswordPrompt

  • All Superinterfaces:
    InputPrompt, Prompt
    All Known Implementing Classes:
    DefaultPasswordPrompt

    public interface PasswordPrompt
    extends InputPrompt
    Interface for password prompts. A password prompt is like an input prompt but masks the input characters.
    • Method Detail

      • getMask

        java.lang.Character getMask()
        Get the mask character to use for hiding input. If null, uses the default mask character '*'.
        Specified by:
        getMask in interface InputPrompt
        Returns:
        the mask character, or null for default
      • showMask

        default boolean showMask()
        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').

        Returns:
        true to show mask characters in the result, false to hide completely