Home / Class/ ShellPrompts Class — spring-boot Architecture

ShellPrompts Class — spring-boot Architecture

Architecture documentation for the ShellPrompts class in ShellPrompts.java from the spring-boot codebase.

Entity Profile

Source Code

cli/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/shell/ShellPrompts.java lines 28–61

public class ShellPrompts {

	private static final String DEFAULT_PROMPT = "$ ";

	private final Deque<String> prompts = new ArrayDeque<>();

	/**
	 * Push a new prompt to be used by the shell.
	 * @param prompt the prompt
	 * @see #popPrompt()
	 */
	public void pushPrompt(String prompt) {
		this.prompts.push(prompt);
	}

	/**
	 * Pop a previously pushed prompt, returning to the previous value.
	 * @see #pushPrompt(String)
	 */
	public void popPrompt() {
		if (!this.prompts.isEmpty()) {
			this.prompts.pop();
		}
	}

	/**
	 * Returns the current prompt.
	 * @return the current prompt
	 */
	public String getPrompt() {
		return this.prompts.isEmpty() ? DEFAULT_PROMPT : this.prompts.peek();
	}

}

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free