Class PasswordCallback

    • Constructor Detail

      • PasswordCallback

        public PasswordCallback​(String prompt)
        Construct a PasswordCallback with a prompt.
        Parameters:
        prompt - the prompt used to request the name.
        Throws:
        IllegalArgumentException - if prompt is null.
      • PasswordCallback

        public PasswordCallback​(String prompt,
                                String defaultPassword)
        Construct a PasswordCallback with a prompt and default password.

        Parameters:
        prompt - the prompt used to request the information.

        defaultPassword - the name to be used as the default name displayed with the prompt.
        Throws:
        IllegalArgumentException - if prompt is null.
    • Method Detail

      • getPrompt

        public String getPrompt()
        Get the prompt.

        Returns:
        the prompt.
      • getDefaultPassword

        public String getDefaultPassword()
        Get the default password.

        Returns:
        the default password, or null if this PasswordCallback was not instantiated with a defaultPassword.
      • setPassword

        public void setPassword​(String pw)
        Set the retrieved password.

        Parameters:
        pw - the password (which may be null).
        See Also:
        getPassword()