Interface Prompter

All Superinterfaces:
Service
All Known Implementing Classes:
DefaultPrompter

@Experimental public interface Prompter extends Service
Service used to interact with the end user.
Since:
4.0
  • Method Details

    • prompt

      default String prompt(String message) throws PrompterException
      Prompts the user for a string.
      Parameters:
      message - the message to display to the user
      Returns:
      the string entered by the user
      Throws:
      PrompterException - if an exception occurs
    • prompt

      default String prompt(String message, String defaultReply) throws PrompterException
      Prompts the user for a string using a default value.
      Parameters:
      message - the message to display
      defaultReply - the default reply value
      Returns:
      the string entered by the user
      Throws:
      PrompterException - if an exception occurs
    • prompt

      default String prompt(String message, List<String> possibleValues) throws PrompterException
      Prompts the user for a string using a list of possible values.
      Parameters:
      message - the message to display
      possibleValues - the list of possible values
      Returns:
      the string entered by the user
      Throws:
      PrompterException - if an exception occurs
    • prompt

      String prompt(String message, List<String> possibleValues, String defaultReply) throws PrompterException
      Prompts the user for a string using a list of possible values and a default reply.
      Parameters:
      message - the message to display
      possibleValues - the list of possible values
      defaultReply - the default reply value
      Returns:
      the string entered by the user
      Throws:
      PrompterException - if an exception occurs
    • promptForPassword

      String promptForPassword(String message) throws PrompterException
      Prompts the user for a password.
      Parameters:
      message - the message to display
      Returns:
      the password entered by the user
      Throws:
      PrompterException - if an exception occurs
    • showMessage

      void showMessage(String message) throws PrompterException
      Displays a message to the user.
      Parameters:
      message - the message to display
      Throws:
      PrompterException - if an exception occurs