Interface Prompter

All Superinterfaces:
Service

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

    • prompt

      @Nonnull default String prompt(@Nullable 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

      @Nonnull default String prompt(@Nullable String message, @Nullable 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

      @Nonnull default String prompt(@Nullable String message, @Nullable 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

      @Nonnull String prompt(@Nullable String message, @Nullable List<String> possibleValues, @Nullable 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

      @Nonnull String promptForPassword(@Nullable 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(@Nullable String message) throws PrompterException
      Displays a message to the user.
      Parameters:
      message - the message to display
      Throws:
      PrompterException - if an exception occurs